linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: Vlastimil Babka <vbabka@suse.cz>,
	Michal Hocko <mhocko@kernel.org>,
	Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, shli@kernel.org
Subject: Re: [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page()
Date: Thu, 2 Nov 2017 17:14:40 +0530	[thread overview]
Message-ID: <40de21c5-9f6e-d34a-6db5-445c43a1266b@linux.vnet.ibm.com> (raw)
In-Reply-To: <23110557-b2db-9f4a-d072-ad58fd0c1931@suse.cz>

On 10/31/2017 06:15 PM, Vlastimil Babka wrote:
> On 10/19/2017 05:33 PM, Michal Hocko wrote:
>> On Thu 19-10-17 20:26:57, Anshuman Khandual wrote:
>>> Its already assumed that the PageActive flag is clear on the input
>>> page, hence page_lru(page) will pick the base LRU for the page. In
>>> the same way page_lru(page) will pick active base LRU, once the
>>> flag PageActive is set on the page. This change of LRU list should
>>> happen implicitly through the page flags instead of being hard
>>> coded.
>>
>> The patch description tells what but it doesn't explain _why_? Does the
>> resulting code is better, more optimized or is this a pure readability
>> thing?
>>
>> All I can see is that page_lru is more complex and a large part of it
>> can be optimized away which has been done manually here. I suspect the
>> compiler can deduce the same thing.
> 
> We shouldn't overestimate the compiler (or the objective conditions it
> has) for optimizing stuff away:
> 
> After applying the patch:
> 
> ./scripts/bloat-o-meter swap_before.o mm/swap.o
> add/remove: 0/0 grow/shrink: 1/0 up/down: 160/0 (160)
> function                                     old     new   delta
> __activate_page                              708     868    +160
> Total: Before=13538, After=13698, chg +1.18%
> 
> I don't think we want that, it's not exactly a cold code...

Yeah, makes sense.

      reply	other threads:[~2017-11-02 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:56 [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page() Anshuman Khandual
2017-10-19 15:33 ` Michal Hocko
2017-10-23  3:22   ` Anshuman Khandual
2017-10-27  4:06     ` Anshuman Khandual
2017-10-27  7:57       ` Michal Hocko
2017-10-31 12:45   ` Vlastimil Babka
2017-11-02 11:44     ` Anshuman Khandual [this message]

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=40de21c5-9f6e-d34a-6db5-445c43a1266b@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=shli@kernel.org \
    --cc=vbabka@suse.cz \
    /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).