Thread (7 messages) 7 messages, 3 authors, 2017-11-02

Re: [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page()

From: Michal Hocko <mhocko@kernel.org>
Date: 2017-10-27 07:57:30
Also in: lkml

On Fri 27-10-17 09:36:37, Anshuman Khandual wrote:
On 10/23/2017 08:52 AM, Anshuman Khandual wrote:
quoted
On 10/19/2017 09:03 PM, Michal Hocko wrote:
quoted
On Thu 19-10-17 20:26:57, Anshuman Khandual wrote:
quoted
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?
Not really. Not only it removes couple of lines of code but it also
makes it look more logical from function flow point of view as well.
quoted
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.
Why not ? I mean, that is the essence of the function page_lru() which
should get us the exact LRU list the page should be on and hence we
should not hand craft these manually.
Hi Michal,

Did not hear from you on this. So wondering what is the verdict
about this patch ?
IMHO, there is no reason to change the code as it doesn't solve any real
problem or it doesn't make the code more effective AFAICS.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help