From patchwork Fri Dec 25 09:59:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 11990093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 195AFC433E0 for ; Fri, 25 Dec 2020 10:02:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81038230FF for ; Fri, 25 Dec 2020 10:02:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81038230FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1E5AD8D0086; Fri, 25 Dec 2020 05:02:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C0308D0080; Fri, 25 Dec 2020 05:02:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FE0A8D0086; Fri, 25 Dec 2020 05:02:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0155.hostedemail.com [216.40.44.155]) by kanga.kvack.org (Postfix) with ESMTP id E14328D0080 for ; Fri, 25 Dec 2020 05:02:07 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A068D3630 for ; Fri, 25 Dec 2020 10:02:07 +0000 (UTC) X-FDA: 77631363894.07.bikes93_350974427479 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 8496018014EC1 for ; Fri, 25 Dec 2020 10:02:07 +0000 (UTC) X-HE-Tag: bikes93_350974427479 X-Filterd-Recvd-Size: 2390 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 25 Dec 2020 10:02:03 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0UJjFIVO_1608890514; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UJjFIVO_1608890514) by smtp.aliyun-inc.com(127.0.0.1); Fri, 25 Dec 2020 18:01:55 +0800 From: Alex Shi To: willy@infradead.org Cc: tim.c.chen@linux.intel.com, Konstantin Khlebnikov , Hugh Dickins , Yu Zhao , Michal Hocko , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/4] pre sort pages on lruvec in pagevec Date: Fri, 25 Dec 2020 17:59:46 +0800 Message-Id: <1608890390-64305-1-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20201126155553.GT4327@casper.infradead.org> References: <20201126155553.GT4327@casper.infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This idea was tried on per memcg lru lock patchset v18, and had a good result, about 5%~20+% performance gain on lru lock busy benchmarks, like case-lru-file-readtwice. But on the latest kernel, I can not reproduce the result on my box. Also I can not reproduce Tim's performance gain too on my box. So I don't know if it's workable in some scenario, just sent out if someone has interesting... Alex Shi (4): mm/swap.c: pre-sort pages in pagevec for pagevec_lru_move_fn mm/swap.c: bail out early for no memcg and no numa mm/swap.c: extend the usage to pagevec_lru_add mm/swap.c: no sort if all page's lruvec are same Cc: Konstantin Khlebnikov Cc: Hugh Dickins Cc: Yu Zhao Cc: Michal Hocko Cc: Matthew Wilcox (Oracle) Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org mm/swap.c | 118 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 27 deletions(-)