linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH v1] mm/memory_hotplug: don't check the nid in find_(smallest|biggest)_section_pfn
Date: Wed, 27 Nov 2019 14:03:22 -0500	[thread overview]
Message-ID: <74CE315E-319F-4D2D-8276-7F89293286CF@lca.pw> (raw)
In-Reply-To: <20191127174158.28226-1-david@redhat.com>



> On Nov 27, 2019, at 12:42 PM, David Hildenbrand <david@redhat.com> wrote:
> 
> Now that we always check against a zone, we can stop checking against
> the nid, it is implicitly covered by the zone.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Oscar Salvador <osalvador@suse.de>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> mm/memory_hotplug.c | 23 ++++++++---------------
> 1 file changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 46b2e056a43f..602f753c662c 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -344,17 +344,14 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
> }
> 
> /* find the smallest valid pfn in the range [start_pfn, end_pfn) */
> -static unsigned long find_smallest_section_pfn(int nid, struct zone *zone,
> -                     unsigned long start_pfn,
> -                     unsigned long end_pfn)
> +static unsigned long find_smallest_section_pfn(struct zone *zone,
> +                           unsigned long start_pfn,
> +                           unsigned long end_pfn)
> {
>    for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SUBSECTION) {
>        if (unlikely(!pfn_to_online_page(start_pfn)))
>            continue;
> 
> -        if (unlikely(pfn_to_nid(start_pfn) != nid))
> -            continue;

Are you sure? I thought this is to check against machines with odd layouts, no? 

			/*
			 * Nodes's pfns can be overlapping.
			 * We know some arch can have a nodes layout such as
			 * -------------pfn-------------->
			 * N0 | N1 | N2 | N0 | N1 | N2|....
			 */



  reply	other threads:[~2019-11-27 19:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 17:41 [PATCH v1] mm/memory_hotplug: don't check the nid in find_(smallest|biggest)_section_pfn David Hildenbrand
2019-11-27 19:03 ` Qian Cai [this message]
2019-11-27 19:05   ` David Hildenbrand
2019-11-27 19:37     ` Qian Cai
2019-11-27 19:52       ` David Hildenbrand
2019-11-27 20:49         ` David Hildenbrand
2019-11-27 22:56           ` Qian Cai
2019-11-28  8:46             ` David Hildenbrand
2019-11-28 13:56               ` Qian Cai
2019-11-28 14:03                 ` David Hildenbrand
2019-11-28 14:30                   ` Qian Cai
2019-11-28 14:42                     ` Michal Hocko
2019-11-28 14:52                       ` David Hildenbrand
2019-11-28 15:29                         ` Qian Cai
2019-11-28 15:31                           ` David Hildenbrand
2019-11-28 17:31                             ` Qian Cai
2019-11-28 15:46                           ` Michal Hocko
2019-11-28 17:22                             ` Qian Cai
2019-11-28 10:15 ` Michal Hocko
2019-11-28 13:52 ` Oscar Salvador

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74CE315E-319F-4D2D-8276-7F89293286CF@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=osalvador@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).