From: Wei Yang <richard.weiyang@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Wei Yang <richard.weiyang@gmail.com>,
willy@infradead.org, mhocko@suse.com,
mgorman@techsingularity.net, linux-mm@kvack.org,
akpm@linux-foundation.org
Subject: Re: [RFC] put page to pcp->lists[] tail if it is not on the same node
Date: Sat, 20 Oct 2018 01:38:11 +0000 [thread overview]
Message-ID: <20181020013811.tzhxz6sjv3g2g5c5@master> (raw)
In-Reply-To: <36be02a3-cdb9-15d0-a491-eba34675db3b@suse.cz>
On Fri, Oct 19, 2018 at 03:43:29PM +0200, Vlastimil Babka wrote:
>On 10/19/18 6:33 AM, Wei Yang wrote:
>> @@ -2763,7 +2764,14 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn)
>> }
>>
>> pcp = &this_cpu_ptr(zone->pageset)->pcp;
>> - list_add(&page->lru, &pcp->lists[migratetype]);
>
>My impression is that you think there's only one pcp per cpu. But the
>"pcp" here is already specific to the zone (and thus node) of the page
>being freed. So it doesn't matter if we put the page to the list or
>tail. For allocation we already typically prefer local nodes, thus local
>zones, thus pcp's containing only local pages.
>
Your guess is right. :-)
I took a look in the code
zone->pageset = alloc_percpu(struct per_cpu_pageset);
each zone has its pageset.
This means just a portion of the pageset is used on a multi-node
system, since a node just belongs to one node. Could we allocate just
this part or initialize just this part? Maybe it is too small to polish.
Well, I am lost on when we will allocate a page from remote node. Let me
try to understand :-)
>> + /*
>> + * If the page has the same node_id as this cpu, put the page at head.
>> + * Otherwise, put at the end.
>> + */
>> + if (page_node == pcp->node)
>
>So this should in fact be always true due to what I explained above.
>
>Otherwise I second the recommendation from Mel.
>
Sure, I have to say you are right.
BTW, is there other channel not as formal as mail list to raise some
question or discussion? Reading the code alone is not that exciting and
sometimes when I get some idea or confusion, I really willing to chat
with someone or to understand why it is so.
Mail list seems not the proper channel, maybe the irc is a proper way?
>Cheers,
>Vlastimil
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2018-10-20 1:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 4:33 Wei Yang
2018-10-19 8:38 ` Mel Gorman
2018-10-20 0:54 ` Wei Yang
2018-10-20 16:33 ` Wei Yang
2018-10-21 2:36 ` Wei Yang
2018-10-21 12:12 ` Mel Gorman
2018-10-22 1:24 ` Wei Yang
2018-10-19 13:43 ` Vlastimil Babka
2018-10-20 1:38 ` Wei Yang [this message]
2018-10-20 16:10 ` 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=20181020013811.tzhxz6sjv3g2g5c5@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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