Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp142833pxa; Tue, 4 Aug 2020 01:38:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaceUVY62iL2KM9FOBXCjMGutsFfjGyqWdJ5l0Nh/7IPqKdt9pz76YPNC6Eiq8szzAejtD X-Received: by 2002:a17:906:7802:: with SMTP id u2mr19846486ejm.206.1596530281647; Tue, 04 Aug 2020 01:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596530281; cv=none; d=google.com; s=arc-20160816; b=GGIaYI0/FeGp4rBXou0jsDqBRQMNyNNsd94mckCHTOn5rU0OjslB9XvGewVs57PoZG OauKY9YJvSgVvcUq/AsyXgo2RYX//yNz8flTCBu0E3UN7/erYc3xLoUqFWicJtY1EjEQ hO22YyR4e2WhJuE1zYFPfqV0CYsjUFXtt2IP/ZyJ7eUqVRxaNqD3WEHhei7d26JP0atp JKs5VO4CMuP1OwPUUnExux4L0WuE5fU4uqzj/u6+x3oED3CgHFgPTk1bMeS/Ny4bVA4U LGx7e+JDcyxgoAYiII1qW6Rp3PXp3BLyAVTHe6dbVHlFNSZEbz0ci8CQVJWGdg55jGpx IDyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:references:to:from:subject; bh=uYWFVjJqmu7SRpdvPftCsEImUr9xd+sZugYio3XVIJo=; b=0qzLhKGlaGaHEOLKGeg/avPAgghF+iwqZZEsg9ZVSlff9NnCl90h3aIILELTS6Njzk Ew5nU8pvHVJZ3nZznDxqFgRGAlq4X5nQaIlF3mdsF5Sh2hnZ1Y815ONIUx3dKQRrGvz/ FTylf+gvSM4gwFQkc4UQ4AfC+DcbZ2loKnzgKxyMB5doobohx2p5GXUUBHH/1aDZqfXm I6th4f4nbTT6qqHKS5h9WpzdknWx8dURFAnFk+tBVEVk+0Wk567WeupJeAgsOB1w/LD+ 4FIdIBREzcuDNLGsnbbOR+hAk+uxRcCska2lGCG8vzrhGEBxukxedDfeZfrHpAocdfT8 0HKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si12521974edd.112.2020.08.04.01.37.38; Tue, 04 Aug 2020 01:38:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729936AbgHDIgw (ORCPT + 99 others); Tue, 4 Aug 2020 04:36:52 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:42492 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726058AbgHDIgw (ORCPT ); Tue, 4 Aug 2020 04:36:52 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0U4jpNEg_1596530205; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U4jpNEg_1596530205) by smtp.aliyun-inc.com(127.0.0.1); Tue, 04 Aug 2020 16:36:46 +0800 Subject: Re: [PATCH v17 00/21] per memcg lru lock From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, Michal Hocko , Vladimir Davydov References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> Message-ID: Date: Tue, 4 Aug 2020 16:36:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From 6f3ac2a72448291a88f50df836d829a23e7df736 Mon Sep 17 00:00:00 2001 From: Alex Shi Date: Sat, 25 Jul 2020 22:52:11 +0800 Subject: [PATCH 2/3] mm/mlock: remove __munlock_isolate_lru_page The func only has one caller, remove it to clean up code and simplify code. Signed-off-by: Alex Shi Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/mlock.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index 46a05e6ec5ba..40a8bb79c65e 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -102,23 +102,6 @@ void mlock_vma_page(struct page *page) } /* - * Isolate a page from LRU with optional get_page() pin. - * Assumes lru_lock already held and page already pinned. - */ -static bool __munlock_isolate_lru_page(struct page *page, - struct lruvec *lruvec, bool getpage) -{ - if (TestClearPageLRU(page)) { - if (getpage) - get_page(page); - del_page_from_lru_list(page, lruvec, page_lru(page)); - return true; - } - - return false; -} - -/* * Finish munlock after successful page isolation * * Page must be locked. This is a wrapper for try_to_munlock() @@ -300,7 +283,10 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone) * We already have pin from follow_page_mask() * so we can spare the get_page() here. */ - if (__munlock_isolate_lru_page(page, lruvec, false)) { + if (TestClearPageLRU(page)) { + enum lru_list lru = page_lru(page); + + del_page_from_lru_list(page, lruvec, lru); unlock_page_memcg(page); continue; } else -- 1.8.3.1