From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbdJ0H5a (ORCPT ); Fri, 27 Oct 2017 03:57:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:50462 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbdJ0H53 (ORCPT ); Fri, 27 Oct 2017 03:57:29 -0400 Date: Fri, 27 Oct 2017 09:57:27 +0200 From: Michal Hocko To: Anshuman Khandual 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() Message-ID: <20171027075727.pc7mj4giv3anewbi@dhcp22.suse.cz> References: <20171019145657.11199-1-khandual@linux.vnet.ibm.com> <20171019153322.c4uqalws7l7fdzcx@dhcp22.suse.cz> <2fc28494-d0d2-9b65-aeb7-1ccabf210917@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2fc28494-d0d2-9b65-aeb7-1ccabf210917@linux.vnet.ibm.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-10-17 09:36:37, Anshuman Khandual wrote: > On 10/23/2017 08:52 AM, Anshuman Khandual wrote: > > On 10/19/2017 09:03 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? > > > > 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. > > > >> > >> 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