linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration
Date: Thu, 15 Nov 2018 13:37:35 -0800	[thread overview]
Message-ID: <20181115133735.bb0313ec9293c415d08be550@linux-foundation.org> (raw)
In-Reply-To: <20181114235040.36180-1-richard.weiyang@gmail.com>

On Thu, 15 Nov 2018 07:50:40 +0800 Wei Yang <richard.weiyang@gmail.com> 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.
> 
>     present_pages is physical pages existing within the zone
>     managed_pages is present pages managed by the buddy system
> 
> >From the definition, managed_pages is a more strict condition than
> present_pages.
> 
> There are two functions using zone's present_pages as a boundary:
> 
>     populated_zone()
>     for_each_populated_zone()
> 
> By going through the kernel tree, most of their users are willing to
> access pages managed by the buddy system, which means it is more exact
> to check zone's managed_pages for a validation.
> 
> This patch replaces those checks on present_pages to managed_pages by:
> 
>     * change for_each_populated_zone() to for_each_managed_zone()
>     * convert for_each_populated_zone() to for_each_zone() and check
>       populated_zone() where is necessary
>     * change populated_zone() to managed_zone() at proper places
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> 
> ---
> 
> Michal, after last mail, I did one more thing to replace
> populated_zone() with managed_zone() at proper places.
> 
> One thing I am not sure is those places in mm/compaction.c. I have
> chaged them. If not, please let me know.
> 
> BTW, I did a boot up test with the patched kernel and looks smooth.

Seems sensible, but a bit scary.  A basic boot test is unlikely to
expose subtle gremlins.

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.

I'll toss it in there for now, let's see who breaks :(

  reply	other threads:[~2018-11-15 21:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 23:50 Wei Yang
2018-11-15 21:37 ` Andrew Morton [this message]
2018-11-16  4:41   ` Wei Yang
2018-11-16  9:57   ` Michal Hocko
2018-11-16 11:05     ` osalvador
2018-11-16 11:26       ` Michal Hocko
2018-11-16 15:58         ` Wei Yang
2018-11-16 17:07           ` Michal Hocko
2018-11-16 10:24 ` Michal Hocko
2018-11-21  3:05   ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181115133735.bb0313ec9293c415d08be550@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=richard.weiyang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox