Ohhoon Kwon fc1f5e980a mm: sparse: pass section_nr to find_memory_block
With CONFIG_SPARSEMEM_EXTREME enabled, __section_nr() which converts
mem_section to section_nr could be costly since it iterates all section
roots to check if the given mem_section is in its range.

On the other hand, __nr_to_section() which converts section_nr to
mem_section can be done in O(1).

Let's pass section_nr instead of mem_section ptr to find_memory_block() in
order to reduce needless iterations.

Link: https://lkml.kernel.org/r/20210707150212.855-3-ohoono.kwon@samsung.com
Signed-off-by: Ohhoon Kwon <ohoono.kwon@samsung.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-09-03 09:58:14 -07:00
..
2021-08-20 21:11:43 +02:00
2021-07-30 10:56:47 -07:00
2021-06-30 15:51:09 -07:00
2021-08-27 16:08:29 -07:00
2021-06-30 15:34:19 -06:00
2021-07-10 09:22:44 -07:00
2021-06-17 17:37:18 -07:00
2021-08-06 11:08:24 -07:00
2021-07-13 15:15:17 +02:00
2021-08-15 06:38:26 -10:00
2021-07-10 11:53:06 -07:00
2021-07-09 15:35:13 +02:00
2021-07-05 14:08:24 -07:00
2021-08-07 10:26:21 -07:00
2021-06-30 12:12:56 -07:00
2021-07-05 13:51:41 -07:00
2021-08-16 06:36:01 -10:00
2021-08-26 11:08:32 -07:00
2021-07-24 12:57:06 -07:00
2021-07-03 10:54:08 -07:00
2021-08-27 00:27:15 +02:00
2021-08-16 11:11:06 +01:00
2021-07-21 12:37:49 -07:00
2021-07-07 10:50:03 -07:00
2021-07-10 16:19:10 -07:00
2021-08-28 11:39:16 -07:00
2021-08-16 22:42:02 +02:00
2021-08-06 11:15:02 -07:00
2021-08-16 06:16:25 -10:00
2021-07-03 11:49:33 -07:00
2021-07-16 11:14:54 -07:00
2021-07-07 12:57:46 -07:00
2021-08-14 06:31:22 -10:00
2021-06-16 08:53:58 -06:00
2021-06-29 11:21:35 -07:00