]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory_hotplug.c: simplify calculation of number of pages in __remove_pages()
authorDavid Hildenbrand <david@redhat.com>
Tue, 7 Apr 2020 03:06:53 +0000 (20:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:40 +0000 (10:43 -0700)
commit9de9f60c501e765b029ccbd82f5825297c1692da
tree2af23e6685ae6368dab99a419a7272df3ee59299
parent7c2a0d9838f46292cee1fae40cbd4e44cb6ca65a
mm/memory_hotplug.c: simplify calculation of number of pages in __remove_pages()

In commit b1068703c56d ("mm/memory_hotplug: cleanup __remove_pages()"), we
cleaned up __remove_pages(), and introduced a shorter variant to calculate
the number of pages to the next section boundary.

Turns out we can make this calculation easier to read.  We always want to
have the number of pages (> 0) to the next section boundary, starting from
the current pfn.

We'll clean up __remove_pages() in a follow-up patch and directly make use
of this computation.

Suggested-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Link: http://lkml.kernel.org/r/20200228095819.10750-2-david@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory_hotplug.c