From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 ED5BCC433E0 for ; Sat, 20 Jun 2020 23:08:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 981A12474D for ; Sat, 20 Jun 2020 23:08:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="p2z32yzB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 981A12474D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EA14C6B00D4; Sat, 20 Jun 2020 19:08:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E51E06B00D5; Sat, 20 Jun 2020 19:08:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D67118D0008; Sat, 20 Jun 2020 19:08:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id BCD336B00D4 for ; Sat, 20 Jun 2020 19:08:10 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3AECE1EE6 for ; Sat, 20 Jun 2020 23:08:10 +0000 (UTC) X-FDA: 76951130340.16.music88_52044ad26e25 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 045DF100E6903 for ; Sat, 20 Jun 2020 23:08:09 +0000 (UTC) X-HE-Tag: music88_52044ad26e25 X-Filterd-Recvd-Size: 4505 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Sat, 20 Jun 2020 23:08:09 +0000 (UTC) Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BF722474A; Sat, 20 Jun 2020 23:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592694488; bh=2IEhfBYyQCSyZpnt+8yfDe7vxNgCoT7PUvnS8+aWFus=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=p2z32yzBQhfcyRgHHNzs+5IIrjXsczCwFLqNTLfNQZAgGw2PskunGFm17A39sq7F7 h5teGa9mbxApkzTetkvnhBrzC0Q/6z12nDNoEFjq+RsTefTJN/7BmVbrlNyygUWIN+ YZXHA6FESindISNeo/FJ3Fbf/7UT2GK19N71Vke0= Date: Sat, 20 Jun 2020 16:08:07 -0700 From: Andrew Morton To: Alex Shi Cc: 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 Subject: Re: [PATCH v13 00/18] per memcg lru lock Message-Id: <20200620160807.0e0997c3e0e3ca1b18e68a53@linux-foundation.org> In-Reply-To: <1592555636-115095-1-git-send-email-alex.shi@linux.alibaba.com> References: <1592555636-115095-1-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 045DF100E6903 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Fri, 19 Jun 2020 16:33:38 +0800 Alex Shi wrote: > This is a new version which bases on linux-next, merged much suggestion > from Hugh Dickins, from compaction fix to less TestClearPageLRU and > comments reverse etc. Thank a lot, Hugh! > > Johannes Weiner has suggested: > "So here is a crazy idea that may be worth exploring: > > Right now, pgdat->lru_lock protects both PageLRU *and* the lruvec's > linked list. > > Can we make PageLRU atomic and use it to stabilize the lru_lock > instead, and then use the lru_lock only serialize list operations? I don't understand this sentence. How can a per-page flag stabilize a per-pgdat spinlock? Perhaps some additional description will help. > ..." > > With new memcg charge path and this solution, we could isolate > LRU pages to exclusive visit them in compaction, page migration, reclaim, > memcg move_accunt, huge page split etc scenarios while keeping pages' > memcg stable. Then possible to change per node lru locking to per memcg > lru locking. As to pagevec_lru_move_fn funcs, it would be safe to let > pages remain on lru list, lru lock could guard them for list integrity. > > The patchset includes 3 parts: > 1, some code cleanup and minimum optimization as a preparation. > 2, use TestCleanPageLRU as page isolation's precondition > 3, replace per node lru_lock with per memcg per node lru_lock > > The 3rd part moves per node lru_lock into lruvec, thus bring a lru_lock for > each of memcg per node. So on a large machine, each of memcg don't > have to suffer from per node pgdat->lru_lock competition. They could go > fast with their self lru_lock > > Following Daniel Jordan's suggestion, I have run 208 'dd' with on 104 > containers on a 2s * 26cores * HT box with a modefied case: > https://git.kernel.org/pub/scm/linux/kernel/git/wfg/vm-scalability.git/tree/case-lru-file-readtwice > > With this patchset, the readtwice performance increased about 80% > in concurrent containers. > > Thanks Hugh Dickins and Konstantin Khlebnikov, they both brought this > idea 8 years ago, and others who give comments as well: Daniel Jordan, > Mel Gorman, Shakeel Butt, Matthew Wilcox etc. > > Thanks for Testing support from Intel 0day and Rong Chen, Fengguang Wu, > and Yun Wang. Hugh Dickins also shared his kbuild-swap case. Thanks! > > ... > > 24 files changed, 500 insertions(+), 357 deletions(-) It's a large patchset and afaict the whole point is performance gain. 80% in one specialized test sounds nice, but is there a plan for more extensive quantification? There isn't much sign of completed review activity here, so I'll go into hiding for a while.