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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 30189C2BA83 for ; Sat, 15 Feb 2020 12:59:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7E8B2083B for ; Sat, 15 Feb 2020 12:59:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WE1bxtXB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7E8B2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 225116B0005; Sat, 15 Feb 2020 07:59:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D4B86B0006; Sat, 15 Feb 2020 07:59:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C4966B0007; Sat, 15 Feb 2020 07:59:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id E866B6B0005 for ; Sat, 15 Feb 2020 07:59:36 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 87A1D824934B for ; Sat, 15 Feb 2020 12:59:36 +0000 (UTC) X-FDA: 76492367952.14.books02_53c00e5b12f17 X-HE-Tag: books02_53c00e5b12f17 X-Filterd-Recvd-Size: 8349 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Sat, 15 Feb 2020 12:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581771574; 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=OmQbovRCD30M1DZE94mk2gFEoHLVoHlFJSKFZ0Itf1Q=; b=WE1bxtXBEEBz50Ng8YDGD6FRXxxgeDh6xXp6581mGjIDRdRoG9oLptVAQOlb6QuL7KDXuL o687OEV9A4eo+DyLx59CEqg4WAQZqIn6EoiEm+N2c9OIxeTYTkHN0nv+2LiP+1Xpkd3XA+ Ybi6Atm8apQIYxJo427dLjj274nSZ/E= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-73-tAhVFD0XNrCoH3QM5qzcSA-1; Sat, 15 Feb 2020 07:59:33 -0500 Received: by mail-wr1-f70.google.com with SMTP id l1so5719708wrt.4 for ; Sat, 15 Feb 2020 04:59:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=ga2DAEyiO9OO5t8fCB6yyUiUfndsxYGMLb2AcRPc1r0=; b=lVLkz2tuBbDBFdUo86gALGQpX/iqnFY3rhVfDQV6pJxZsHMegGaoHZJaQCHTgEzidr p1xq+wXfXlkyVPSMdSu+4CwsIPVJ86cnNIudizfCzGfRU6TDsCICOV3o3rUtbq17FY2J XV2YksEqN17viovwGXAZcAMcA5h6x9/4HlZ72MA/Fc+vbpyTTa3T12buipxWl4pOTxR5 2scXkURnVVZCSqFlIn+xzShKfM2OSA0qU99WAlKXxuHp8yM4AAu1C2sqqQDohXkQizLX nsj2ECuHhSU3UahOi5+tkT9K5kCbeHcW+5TlEbSy7oSiGAGlBFdYQqxamp3TCw6Wav6b pnEg== X-Gm-Message-State: APjAAAU6zwo0BPLfzhuQz0d8u7dROUdFs/xEoAqjy5huPNZEcqjqet/W Jnc9WCRS1OBplIbGib8xl23ZkacZmFPjR6oDp9INzY0DMTONSmku90qO0v1yJe7lKdGIlUT2QpE KC/dd4swVJfs= X-Received: by 2002:a05:600c:295d:: with SMTP id n29mr10875516wmd.101.1581771572102; Sat, 15 Feb 2020 04:59:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxWec3EeDrwa0f2mcfcVCfK7RmjPMDlG+rGckl+8gaSb63jjbp/vu+9dEG8ZTcFXaw5n/ee6Q== X-Received: by 2002:a05:600c:295d:: with SMTP id n29mr10875496wmd.101.1581771571869; Sat, 15 Feb 2020 04:59:31 -0800 (PST) Received: from ?IPv6:2a01:598:b900:81d7:5461:d59c:2c6b:6afa? ([2a01:598:b900:81d7:5461:d59c:2c6b:6afa]) by smtp.gmail.com with ESMTPSA id z21sm11796799wml.5.2020.02.15.04.59.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Feb 2020 04:59:31 -0800 (PST) From: David Hildenbrand Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] mm/sparse: rename pfn_present() as pfn_to_section_present() Date: Sat, 15 Feb 2020 13:59:30 +0100 Message-Id: <0257D252-E03E-4900-89CC-B26C58691F68@redhat.com> References: <1581747422-7388-1-git-send-email-kernelfans@gmail.com> Cc: linux-mm@kvack.org, Dan Williams , Michal Hocko , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , David Hildenbrand , Leonardo Bras , Nathan Fontenot , Nathan Lynch In-Reply-To: <1581747422-7388-1-git-send-email-kernelfans@gmail.com> To: Pingfan Liu X-Mailer: iPhone Mail (17D50) X-MC-Unique: tAhVFD0XNrCoH3QM5qzcSA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: > Am 15.02.2020 um 07:19 schrieb Pingfan Liu : >=20 > =EF=BB=BFAfter introducing mem sub section concept, pfn_present() loses i= ts literal > meaning, and will not be necessary a truth on partial populated mem secti= on. >=20 > Since all of the callers use it to judge an absent section, it is better = to > rename pfn_present() as pfn_to_section_present(). IMHO, the name is not any better. pfn_in_present_section? Cheers! >=20 > 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(-) >=20 > diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/power= pc/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) >=20 > 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 memory= _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 >=20 > -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 */ >=20 > 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 st= art_pfn, > } >=20 > 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(unsig= ned long pfn, int order) > return NULL; >=20 > /* ...is the pfn in a present section or a hole? */ > - if (!pfn_present(pfn)) > + if (!pfn_to_section_present(pfn)) > return NULL; >=20 > /* ...is the page free and currently on a free_area list? */ > --=20 > 2.7.5 >=20