linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, mgorman@techsingularity.net,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm, page_alloc: skip zone who has no managed_pages in calculate_totalreserve_pages()
Date: Wed, 14 Nov 2018 07:43:41 +0000	[thread overview]
Message-ID: <20181114074341.r53rukmj25ydvaqi@master> (raw)
In-Reply-To: <20181113090758.GL15120@dhcp22.suse.cz>

On Tue, Nov 13, 2018 at 10:07:58AM +0100, Michal Hocko wrote:
>On Tue 13-11-18 08:16:44, Wei Yang wrote:
>
>No, I believe we want all three of them. But reviewing
>for_each_populated_zone users and explicit checks for present/managed
>pages and unify them would be a step forward both a more optimal code
>and more maintainable code. I haven't checked but
>for_each_populated_zone would seem like a proper user for managed page
>counter. But that really requires to review all current users.
>

To sync with your purpose, I searched the user of
for_each_populated_zone() and replace it with a new loop
for_each_managed_zone().

Here is a summary of what I have done.

file                          used     changed
----------------------------------------------
arch/s390/mm/page-states.c    1        1
kernel/power/snapshot.c       7        3
mm/highmem.c                  1        1
mm/huge_memory.c              1        0
mm/khugepaged.c               1        1
mm/madvise.c                  1        1
mm/page_alloc.c               8        8
mm/vmstat.c                   5        5

The general idea to replace for_each_populated_zone() with
for_each_populated_zone() is:

   * access zone->freelist
   * access zone pcp
   * access zone_page_state

Is my understanding comply with what you want? 

>-- 
>Michal Hocko
>SUSE Labs

-- 
Wei Yang
Help you, Help me

  parent reply	other threads:[~2018-11-14  7:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  7:14 [PATCH] mm, page_alloc: skip zone who has no managed_pages in calculate_totalreserve_pages() Wei Yang
2018-11-12  8:09 ` Michal Hocko
2018-11-12 14:26   ` Wei Yang
2018-11-12 14:40     ` Michal Hocko
2018-11-13  1:39       ` Wei Yang
2018-11-13  8:08         ` Michal Hocko
2018-11-13  8:16           ` Wei Yang
2018-11-13  9:07             ` Michal Hocko
2018-11-13  9:14               ` Wei Yang
2018-11-14  7:43               ` Wei Yang [this message]
2018-11-14  7:48                 ` Michal Hocko
2018-11-14  8:20                   ` Wei Yang
2018-11-14  8:54                     ` Michal Hocko
2018-11-13  3:11 ` [PATCH] mm, page_alloc: skip to set lowmem_reserve[] for empty zones 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=20181114074341.r53rukmj25ydvaqi@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.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;
as well as URLs for NNTP newsgroup(s).