From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AC9FC7619B for ; Mon, 17 Feb 2020 03:22:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E1ACF2072C for ; Mon, 17 Feb 2020 03:22:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QN5C/stc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1ACF2072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6D7596B0007; Sun, 16 Feb 2020 22:22:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 688236B0008; Sun, 16 Feb 2020 22:22:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59D0A6B000A; Sun, 16 Feb 2020 22:22:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 412F06B0007 for ; Sun, 16 Feb 2020 22:22:58 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 02FD8181AC9CB for ; Mon, 17 Feb 2020 03:22:58 +0000 (UTC) X-FDA: 76498172436.10.son97_712652cf23061 X-HE-Tag: son97_712652cf23061 X-Filterd-Recvd-Size: 7934 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 03:22:57 +0000 (UTC) Received: by mail-il1-f195.google.com with SMTP id f10so12994428ils.8 for ; Sun, 16 Feb 2020 19:22:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GAuOka5ezAt++P0z6TBKkSUL8pu+sY18PXIRCl9q3J0=; b=QN5C/stcR++tAWpsomUTbpHmCuorkKu14QxuGZ1OyBJ5lkkpQKT/XShuOzlQb6NioF GuL1JuAIsMtvRhZ+6mRqf4HhsvqylcgMdkwRSve/s7Mo4aXHGzLtEljik4y86CymL8eI jfpDVpJdKWwwjlJ8fM1o0tfIOQzahuDdnXyji2QKzMINivyYYxmtkhr2rMHRfjOS1P5W fOcodk9Gf6gzguSIzRLfYycJXlXzAGf/nPJXSYgaLfZ/Br1kNqoQqotahbiYU/FvZdP9 S5137CINAuoC6cGjpOBwXQ6LRk3Bf01UJi1XbUkqX2NgfFXfU54sLFfyk6vMNqzTU22U lPQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GAuOka5ezAt++P0z6TBKkSUL8pu+sY18PXIRCl9q3J0=; b=W0qy/M2tjPk45WOGyAuwhigs+QS6hWy8IX7thejx5LkUuUdUck8qC89lisK1PfBLLA Ac0g/4XGmCxO+UAwdiO3AL+4+IaiCP+Y1cmPzWqfl7cK8v0ICobxarQ6QCbQwTZfTF8Z YF4p2EpZ8gE81c94KRWoBDydOFN+C0z4qAtl5aIBQeHCDQFbjAwUN6FvxfMm3eLtkb7N 9EB5h17wG7hM1CNckC5QfUCzwugJFrovOK/CmAquvKXa+oRlSqTJc5A9WP6ZVmNU74n5 nZhaBuEeQSonuWT8sh2tEuKf7+Va3EQkiuNAMNcD2G4rOt8Tdy65fWLKUZLOsuuE1eYI dEkQ== X-Gm-Message-State: APjAAAX5cX0JLrMhVEZJcisKh+r0tcr7Bvt7gPSqHdnm1dePlkemWq1m CnfnpnqHd3lWpXWoGdVN5ZTJhNoOPu8qMg3Sfg== X-Google-Smtp-Source: APXvYqxDyO4slkJp01DD0GkiUu/USHEA7Gb+h+ZSVpvBA9para52swhIpjnioIP+iLhHMNAeqJhXGgnNH9fj712wh3M= X-Received: by 2002:a92:91c7:: with SMTP id e68mr13311175ill.161.1581909776677; Sun, 16 Feb 2020 19:22:56 -0800 (PST) MIME-Version: 1.0 References: <1581747422-7388-1-git-send-email-kernelfans@gmail.com> <0257D252-E03E-4900-89CC-B26C58691F68@redhat.com> In-Reply-To: <0257D252-E03E-4900-89CC-B26C58691F68@redhat.com> From: Pingfan Liu Date: Mon, 17 Feb 2020 11:22:45 +0800 Message-ID: Subject: Re: [PATCH] mm/sparse: rename pfn_present() as pfn_to_section_present() To: David Hildenbrand Cc: Linux-MM , Dan Williams , Michal Hocko , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Leonardo Bras , Nathan Fontenot , Nathan Lynch Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: On Sat, Feb 15, 2020 at 8:59 PM David Hildenbrand wrote: > > > > > Am 15.02.2020 um 07:19 schrieb Pingfan Liu : > > > > =EF=BB=BFAfter introducing mem sub section concept, pfn_present() loses= its literal > > meaning, and will not be necessary a truth on partial populated mem sec= tion. > > > > Since all of the callers use it to judge an absent section, it is bette= r to > > rename pfn_present() as pfn_to_section_present(). > > IMHO, the name is not any better. > > pfn_in_present_section? > Yeah, that sounds better. Thanks, Pingfan > Cheers! > > > > > Signed-off-by: Pingfan Liu > > Cc: Dan Williams > > Cc: Michal Hocko > > Cc: Benjamin Herrenschmidt > > Cc: Paul Mackerras > > Cc: Michael Ellerman > > Cc: Greg Kroah-Hartman > > Cc: "Rafael J. Wysocki" > > Cc: Andrew Morton > > Cc: David Hildenbrand > > Cc: Leonardo Bras > > Cc: Nathan Fontenot > > Cc: Nathan Lynch > > To: linux-mm@kvack.org > > --- > > arch/powerpc/platforms/pseries/hotplug-memory.c | 2 +- > > drivers/base/node.c | 2 +- > > include/linux/mmzone.h | 4 ++-- > > mm/page_ext.c | 2 +- > > mm/shuffle.c | 2 +- > > 5 files changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/pow= erpc/platforms/pseries/hotplug-memory.c > > index a4d40a3..5088132 100644 > > --- a/arch/powerpc/platforms/pseries/hotplug-memory.c > > +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c > > @@ -360,7 +360,7 @@ static bool lmb_is_removable(struct drmem_lmb *lmb) > > > > for (i =3D 0; i < scns_per_block; i++) { > > pfn =3D PFN_DOWN(phys_addr); > > - if (!pfn_present(pfn)) { > > + if (!pfn_to_section_present(pfn)) { > > phys_addr +=3D MIN_MEMORY_BLOCK_SIZE; > > continue; > > } > > diff --git a/drivers/base/node.c b/drivers/base/node.c > > index 98a31ba..6f98568 100644 > > --- a/drivers/base/node.c > > +++ b/drivers/base/node.c > > @@ -772,7 +772,7 @@ static int register_mem_sect_under_node(struct memo= ry_block *mem_blk, > > * memory block could have several absent sections from start. > > * skip pfn range from absent section > > */ > > - if (!pfn_present(pfn)) { > > + if (!pfn_to_section_present(pfn)) { > > pfn =3D round_down(pfn + PAGES_PER_SECTION, > > PAGES_PER_SECTION) - 1; > > continue; > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > > index 462f687..eca2db7 100644 > > --- a/include/linux/mmzone.h > > +++ b/include/linux/mmzone.h > > @@ -1372,7 +1372,7 @@ static inline int pfn_valid(unsigned long pfn) > > } > > #endif > > > > -static inline int pfn_present(unsigned long pfn) > > +static inline int pfn_to_section_present(unsigned long pfn) > > { > > if (pfn_to_section_nr(pfn) >=3D NR_MEM_SECTIONS) > > return 0; > > @@ -1409,7 +1409,7 @@ void sparse_init(void); > > #else > > #define sparse_init() do {} while (0) > > #define sparse_index_init(_sec, _nid) do {} while (0) > > -#define pfn_present pfn_valid > > +#define pfn_to_section_present pfn_valid > > #define subsection_map_init(_pfn, _nr_pages) do {} while (0) > > #endif /* CONFIG_SPARSEMEM */ > > > > diff --git a/mm/page_ext.c b/mm/page_ext.c > > index 4ade843..df0e55e 100644 > > --- a/mm/page_ext.c > > +++ b/mm/page_ext.c > > @@ -304,7 +304,7 @@ static int __meminit online_page_ext(unsigned long = start_pfn, > > } > > > > for (pfn =3D start; !fail && pfn < end; pfn +=3D PAGES_PER_SECTION) = { > > - if (!pfn_present(pfn)) > > + if (!pfn_to_section_present(pfn)) > > continue; > > fail =3D init_section_page_ext(pfn, nid); > > } > > diff --git a/mm/shuffle.c b/mm/shuffle.c > > index b3fe97f..9242cc8 100644 > > --- a/mm/shuffle.c > > +++ b/mm/shuffle.c > > @@ -72,7 +72,7 @@ static struct page * __meminit shuffle_valid_page(uns= igned long pfn, int order) > > return NULL; > > > > /* ...is the pfn in a present section or a hole? */ > > - if (!pfn_present(pfn)) > > + if (!pfn_to_section_present(pfn)) > > return NULL; > > > > /* ...is the page free and currently on a free_area list? */ > > -- > > 2.7.5 > > >