On Thu, Aug 23, 2018 at 03:25:26PM +0200, Michal Hocko wrote: > On Thu 23-08-18 21:07:32, Wei Yang wrote: > > And it is known, __highest_present_section_nr is a more strict boundary > > than NR_MEM_SECTIONS. > > > > This patch uses a __highest_present_section_nr to check a valid pfn. > > But why is this an improvement? Sure when you loop over all sections > than __highest_present_section_nr makes a lot of sense. But all the > updated function perform a trivial comparision. I think it makes some sense. NR_MEM_SECTIONS can be a big number, but we might not be using all sections, so __highest_present_section_nr ends up being a much lower value. I think that we want to compare the pfn's section_nr with our current limit of present sections. Sections over that do not really exist for us, so it is no use to look for them in __nr_to_section/valid_section. It might not be a big improvement, but I think that given the nature of pfn_valid/pfn_present, comparing to __highest_present_section_nr suits better. -- Oscar Salvador SUSE L3