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: Mon, 12 Nov 2018 14:26:41 +0000	[thread overview]
Message-ID: <20181112142641.6oxn4fv4pocm7fmt@master> (raw)
In-Reply-To: <20181112080926.GA14987@dhcp22.suse.cz>

On Mon, Nov 12, 2018 at 09:09:26AM +0100, Michal Hocko wrote:
>On Mon 12-11-18 15:14:04, Wei Yang wrote:
>> Zone with no managed_pages doesn't contribute totalreserv_pages. And the
>> more nodes we have, the more empty zones there are.
>> 
>> This patch skip the zones to save some cycles.
>
>What is the motivation for the patch? Does it really cause any
>measurable difference in performance?
>

The motivation here is to reduce some unnecessary work.

Based on my understanding, almost every node has empty zones, since
zones within a node are ordered in monotonic increasing memory address.

The worst case is all zones has managed_pages. For example, there is
only one node, or configured to have only ZONE_NORMAL and
ZONE_MOVABLE. Otherwise, the more node/zone we have, the more empty
zones there are.

I didn't have detail tests on this patch, since I don't have machine
with large numa nodes. While compared with the following ten lines of
code, this check to skip them is worthwhile to me.


>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> ---
>>  mm/page_alloc.c | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index a919ba5cb3c8..567de15e1106 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -7246,6 +7246,9 @@ static void calculate_totalreserve_pages(void)
>>  			struct zone *zone = pgdat->node_zones + i;
>>  			long max = 0;
>>  
>> +			if (!managed_zone(zone))
>> +				continue;
>> +
>>  			/* Find valid and maximum lowmem_reserve in the zone */
>>  			for (j = i; j < MAX_NR_ZONES; j++) {
>>  				if (zone->lowmem_reserve[j] > max)
>> -- 
>> 2.15.1
>> 
>
>-- 
>Michal Hocko
>SUSE Labs

-- 
Wei Yang
Help you, Help me

  reply	other threads:[~2018-11-12 14:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  7:14 Wei Yang
2018-11-12  8:09 ` Michal Hocko
2018-11-12 14:26   ` Wei Yang [this message]
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
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=20181112142641.6oxn4fv4pocm7fmt@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