Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-20 Thread Wei Yang
On Fri, Nov 16, 2018 at 11:24:05AM +0100, Michal Hocko wrote: >On Thu 15-11-18 07:50:40, Wei Yang wrote: >[...] >> @@ -1193,8 +1196,8 @@ static unsigned int count_free_highmem_pages(void) >> struct zone *zone; >> unsigned int cnt = 0; >> >> -for_each_populated_zone(zone) >> -

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread Michal Hocko
On Fri 16-11-18 15:58:28, Wei Yang wrote: > On Fri, Nov 16, 2018 at 12:26:03PM +0100, Michal Hocko wrote: > >On Fri 16-11-18 12:05:04, osalvador wrote: > >> On Fri, 2018-11-16 at 10:57 +0100, Michal Hocko wrote: > >[...] > >> > E.g. memory hotplug decreases both managed and present counters. I > >>

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread Wei Yang
On Fri, Nov 16, 2018 at 12:26:03PM +0100, Michal Hocko wrote: >On Fri 16-11-18 12:05:04, osalvador wrote: >> On Fri, 2018-11-16 at 10:57 +0100, Michal Hocko wrote: >[...] >> > E.g. memory hotplug decreases both managed and present counters. I >> > am actually not sure that is 100% correct (put on m

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread Michal Hocko
On Fri 16-11-18 12:05:04, osalvador wrote: > On Fri, 2018-11-16 at 10:57 +0100, Michal Hocko wrote: [...] > > E.g. memory hotplug decreases both managed and present counters. I > > am actually not sure that is 100% correct (put on my TODO list to > > check). There is no consistency in that regards.

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread osalvador
On Fri, 2018-11-16 at 10:57 +0100, Michal Hocko wrote: > On Thu 15-11-18 13:37:35, Andrew Morton wrote: > [...] > > Worse, the situations in which managed_zone() != populated_zone() > > are > > rare(?), so it will take a long time for problems to be discovered, > > I > > expect. > > We would basic

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread Michal Hocko
On Thu 15-11-18 07:50:40, Wei Yang wrote: [...] > @@ -1193,8 +1196,8 @@ static unsigned int count_free_highmem_pages(void) > struct zone *zone; > unsigned int cnt = 0; > > - for_each_populated_zone(zone) > - if (is_highmem(zone)) > + for_each_zone(zone) > +

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-16 Thread Michal Hocko
On Thu 15-11-18 13:37:35, Andrew Morton wrote: [...] > Worse, the situations in which managed_zone() != populated_zone() are > rare(?), so it will take a long time for problems to be discovered, I > expect. We would basically have to deplete the whole zone by the bootmem allocator or pull out all

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-15 Thread Wei Yang
On Thu, Nov 15, 2018 at 01:37:35PM -0800, Andrew Morton wrote: >On Thu, 15 Nov 2018 07:50:40 +0800 Wei Yang wrote: > >> For one zone, there are three digits to describe its space range: >> >> spanned_pages >> present_pages >> managed_pages >> >> The detailed meaning is written in inc

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-15 Thread Andrew Morton
On Thu, 15 Nov 2018 07:50:40 +0800 Wei Yang wrote: > For one zone, there are three digits to describe its space range: > > spanned_pages > present_pages > managed_pages > > The detailed meaning is written in include/linux/mmzone.h. This patch > concerns about the last two. > >

[PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-14 Thread Wei Yang
For one zone, there are three digits to describe its space range: spanned_pages present_pages managed_pages The detailed meaning is written in include/linux/mmzone.h. This patch concerns about the last two. present_pages is physical pages existing within the zone managed_page