From patchwork Mon Oct 24 08:14:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13016814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64A78C38A2D for ; Mon, 24 Oct 2022 08:15:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 050DF8E0006; Mon, 24 Oct 2022 04:15:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F044C8E0005; Mon, 24 Oct 2022 04:15:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA43C8E0006; Mon, 24 Oct 2022 04:15:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CB5288E0001 for ; Mon, 24 Oct 2022 04:15:14 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9DE2E120A29 for ; Mon, 24 Oct 2022 08:15:14 +0000 (UTC) X-FDA: 80055132948.13.C3FCBB7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 0A1F51C002E for ; Mon, 24 Oct 2022 08:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666599313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g3MWDQZ+YEFLhc1+KrcZwWlcxn1kI2z+4saRqDzwGGg=; b=NtxNg0iHzGYBL0/u08pCAo8H38CwXaXcI/da0n/quz/rz6rEhuC33FTjAs4WiLP9Q7uvc2 UusPO2mNUOOukg2zbny3aQRKOZAeJpW9ywdf9tTFbEb9wR3bNfsSWXfzjh4xl/k+3UrmH4 pvfAvxG48RPpnnCmoE7+1fcHtldRmf8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-wHg3keIwOaOlWtfbqML-FQ-1; Mon, 24 Oct 2022 04:15:07 -0400 X-MC-Unique: wHg3keIwOaOlWtfbqML-FQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A019101A56C; Mon, 24 Oct 2022 08:15:07 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-35.pek2.redhat.com [10.72.12.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE37940C6FA0; Mon, 24 Oct 2022 08:15:03 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: Dennis Zhou , Tejun Heo , Christoph Lameter , Andrew Morton , linux-mm@kvack.org, Baoquan He Subject: [PATCH 6/8] mm/percpu.c: remove the lcm code since block size is fixed at page size Date: Mon, 24 Oct 2022 16:14:33 +0800 Message-Id: <20221024081435.204970-7-bhe@redhat.com> In-Reply-To: <20221024081435.204970-1-bhe@redhat.com> References: <20221024081435.204970-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666599314; a=rsa-sha256; cv=none; b=Ut9orNkLhtNLSpqDGsz/fXP8PKVPDSV6qEluY7imIFZJx6WEoRhNcHTxTcKsd3K/Mup8mk GGewJ47oeNSIGoDKu/qvCyudf9qiQXVlf+MZ01DaV2HeUtTyWEVdMLhWVQ1kXyt/RsbX84 da0MS0u3LDdKOM4CJtDuOYwWxvnO378= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NtxNg0iH; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666599314; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=g3MWDQZ+YEFLhc1+KrcZwWlcxn1kI2z+4saRqDzwGGg=; b=mxGvX3meKsHwoHfw7k106TmpNlsTRTdUi2ODEvSujOYwklCqpet6eWT8vMaPvNqbpjzCha 0atVFjQgnGiNXyh1HTCSLcg8cFX1yRJ3wxr+P0O2h67KLL1cNOurqnvZdtRQ/G0SK3wJlc sMcb10zdFbkHrIsiN0mR7QGCC1nSmwo= X-Stat-Signature: a33zj6cubxcit57f5tqdaj9agpbc1ncu X-Rspamd-Queue-Id: 0A1F51C002E Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NtxNg0iH; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1666599313-784911 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since commit b239f7daf553 ("percpu: set PCPU_BITMAP_BLOCK_SIZE to PAGE_SIZE"), the PCPU_BITMAP_BLOCK_SIZE has been set to page size fixedly. So the lcm code in pcpu_alloc_first_chunk() doesn't make sense any more, clean it up. Signed-off-by: Baoquan He Acked-by: Dennis Zhou --- mm/percpu.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index 954abf916c7d..96191f7b61ba 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -1347,7 +1346,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr, int map_size) { struct pcpu_chunk *chunk; - unsigned long aligned_addr, lcm_align; + unsigned long aligned_addr; int start_offset, offset_bits, region_size, region_bits; size_t alloc_size; @@ -1355,14 +1354,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr, aligned_addr = tmp_addr & PAGE_MASK; start_offset = tmp_addr - aligned_addr; - - /* - * Align the end of the region with the LCM of PAGE_SIZE and - * PCPU_BITMAP_BLOCK_SIZE. One of these constants is a multiple of - * the other. - */ - lcm_align = lcm(PAGE_SIZE, PCPU_BITMAP_BLOCK_SIZE); - region_size = ALIGN(start_offset + map_size, lcm_align); + region_size = ALIGN(start_offset + map_size, PAGE_SIZE); /* allocate chunk */ alloc_size = struct_size(chunk, populated,