lkml.org 
[lkml]   [2019]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v1] mm/memory_hotplug: don't check the nid in find_(smallest|biggest)_section_pfn
Date


> 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|....
*/

\
 
 \ /
  Last update: 2019-11-27 20:04    [W:0.105 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site