[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23110557-b2db-9f4a-d072-ad58fd0c1931@suse.cz>
Date: Tue, 31 Oct 2017 13:45:39 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Michal Hocko <mhocko@...nel.org>,
Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, shli@...nel.org
Subject: Re: [PATCH] mm/swap: Use page flags to determine LRU list in
__activate_page()
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...
Powered by blists - more mailing lists