Received: by 10.223.164.221 with SMTP id h29csp1940070wrb; Sun, 22 Oct 2017 20:23:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QkgxiSXJQL5oWxpuIePPK/I07a2t0Of7p8+fZ9AeujlbB81qMkh+Ps72EniHlz04Y8rDH1 X-Received: by 10.84.244.198 with SMTP id f6mr9475563plt.32.1508729003295; Sun, 22 Oct 2017 20:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508729003; cv=none; d=google.com; s=arc-20160816; b=N0ef+4bAowyDcKkcbiRiGXrLEkyqt84hByqTxE9vt3I4qSNLoDv/sEnxGdb8OSkNSE E2KL127kIhInzMg3Jp0/RsJGUlwLpcch7TgpHdMY/EUuBcRl9xWX0Ne5cI5gurpX1xWi 1ZvQv+ggVbGV6d9FTo+MvG6UU4GLKWvmsMei47dKaPAJnjQR6Liw8TEwDEHAZkMYxZ9s OPOj5IjsSYubYkhPGKsKO0yx+N38Kz9QP8RhWoV47ZkaHNk6viMPcjCxZ6FEULvhFHPS MrvG7hzHMqlKoYHfHh5t81Ee6K8G5omgA+TXCeiaImvf5N++S0ITDKRd3bc7AwWWV2FK IBzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:from:cc:references:to :subject:arc-authentication-results; bh=nZduBhVoHxb03UcjHztii6oC2KQ2AAGDJjOLKnbaMwA=; b=UrybJkUaJjgavdgONlfW19hetZNS7sVCpNH4v3jWQbUwIERHJ2fq/fDOSnbV28UXSU mvO4mvduHKsli2q4qJoDW+ifMcXIgoF6xoIBazBJ/oOGufCFyGStZbp7846y97wCqBMV WW3N7dprG/soCz9spb8Q+78Rlj1ddTYmVk9smzUHdzP6Pnr2vfSg0G8N8AOliR2hv07k gtBjSeBz8dHHfqD3jXHXcCOakaqBXFj3UWVIVk09+cGGRjpHcJLiwgEwSFWE85YGfZv4 CS8Zu0Ol6ZEBtPGeqqAnDzvaZiA8KjcFEU7k5WKCnBoPQETg8eyAzaVKm3bKTR3gYETd uj0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d86si4675098pfb.62.2017.10.22.20.23.09; Sun, 22 Oct 2017 20:23:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbdJWDWp (ORCPT + 99 others); Sun, 22 Oct 2017 23:22:45 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53754 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdJWDWo (ORCPT ); Sun, 22 Oct 2017 23:22:44 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9N3MNnC122775 for ; Sun, 22 Oct 2017 23:22:43 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2drvm8cgfv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 22 Oct 2017 23:22:43 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Oct 2017 04:22:41 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Oct 2017 04:22:40 +0100 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9N3Mb5g27197604 for ; Mon, 23 Oct 2017 03:22:39 GMT Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v9N3Maf3011723 for ; Mon, 23 Oct 2017 14:22:37 +1100 Received: from localhost.localdomain ([9.122.211.32]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v9N3MZc3011676; Mon, 23 Oct 2017 14:22:35 +1100 Subject: Re: [PATCH] mm/swap: Use page flags to determine LRU list in __activate_page() To: Michal Hocko , Anshuman Khandual References: <20171019145657.11199-1-khandual@linux.vnet.ibm.com> <20171019153322.c4uqalws7l7fdzcx@dhcp22.suse.cz> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, shli@kernel.org From: Anshuman Khandual Date: Mon, 23 Oct 2017 08:52:34 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20171019153322.c4uqalws7l7fdzcx@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17102303-0040-0000-0000-000003E5BD02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102303-0041-0000-0000-000025E822E3 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-23_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710230047 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. From 1581706797533112885@xxx Thu Oct 19 17:12:28 +0000 2017 X-GM-THRID: 1581706618333065037 X-Gmail-Labels: Inbox,Category Forums