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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5267C433FE for ; Wed, 23 Feb 2022 10:58:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 11F738D0002; Wed, 23 Feb 2022 05:58:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CF808D0001; Wed, 23 Feb 2022 05:58:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB2738D0002; Wed, 23 Feb 2022 05:58:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id D81398D0001 for ; Wed, 23 Feb 2022 05:58:48 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 913C6180A62EA for ; Wed, 23 Feb 2022 10:58:48 +0000 (UTC) X-FDA: 79173746736.17.4A40362 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id EB5C3160003 for ; Wed, 23 Feb 2022 10:58:47 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EE4C9B81EBE; Wed, 23 Feb 2022 10:58:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04DEBC340F4; Wed, 23 Feb 2022 10:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645613924; bh=fycgXos7ocYwX+GsKmH5ZzLGjwvqgn7YbCBECVBjK74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ydp5TxtbLmb1PQ/ZAjFAs7FEpMXgXw6IlA4dJIZhOyfrjeOvUYUoPgnaX7Miwl3Gr Mg0PJNfQmpQ2USPiRhL2TBUDN8/k5VY2D2Y68PD2qIRqzJAoXG33USdGD+l2YTACK7 /org/XusQ2P+GCSBvXjO8LL13cDQ09pcLBvvP7HXF2j/RMUcHRgB7V2A76JxDmNxLE zNl5n4BEamMc4F4NmyhUti1McRFVHc9TTcF12oRMCq57+iqjg4o7O67RtiMyBGr2fo TTMAGahBbX3GigGCiFMb1/Y13U3jn5FbgHSQBCSPWbrh9HO1k6cAM4rL3OFqGylfz4 Sfg8Ghb1meM9g== Date: Wed, 23 Feb 2022 12:58:27 +0200 From: Mike Rapoport To: Yu Zhao Cc: Andrew Morton , Johannes Weiner , Mel Gorman , Michal Hocko , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Michael Larabel , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Linux-MM , Kernel Page Reclaim v2 , the arch/x86 maintainers , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?iso-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Subject: Re: [PATCH v7 12/12] mm: multigenerational LRU: documentation Message-ID: References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-13-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EB5C3160003 X-Stat-Signature: zie8i1r9rcktd3zbyrkszbsyz3kaofxb Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Ydp5Txtb; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-HE-Tag: 1645613927-984364 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 Mon, Feb 21, 2022 at 06:47:25PM -0700, Yu Zhao wrote: > On Mon, Feb 21, 2022 at 2:02 AM Mike Rapoport wrote: > > > > On Tue, Feb 15, 2022 at 08:22:10PM -0700, Yu Zhao wrote: > > > > Please consider splitting "enable" and "features" attributes. > > > > > > How about s/Features/Components/? > > > > I meant to use two attributes: > > > > /sys/kernel/mm/lru_gen/enable for the main breaker, and > > /sys/kernel/mm/lru_gen/features (or components) for the branch breakers > > It's a bit superfluous for my taste. I generally consider multiple > items to fall into the same category if they can be expressed by a > type of array, and I usually pack an array into a single file. > > From your last review, I gauged this would be too overloaded for your > taste. So I'd be happy to make the change if you think two files look > more intuitive from user's perspective. I do think that two attributes are more user-friendly, but I don't feel strongly about it. > > > > As for the descriptions, what is the user-visible effect of these features? > > > > How different modes of clearing the access bit are reflected in, say, GUI > > > > responsiveness, database TPS, or probability of OOM? > > > > > > These remain to be seen :) I just added these switches in v7, per Mel's > > > request from the meeting we had. These were never tested in the field. > > > > I see :) > > > > It would be nice to have a description or/and examples of user-visible > > effects when there will be some insight on what these features do. > > How does the following sound? > > Clearing the accessed bit in large batches can theoretically cause > lock contention (mmap_lock), and if it happens the 0x0002 switch can > disable this feature. In this case the multigenerational LRU suffers a > minor performance degradation. > Clearing the accessed bit in non-leaf page table entries was only > verified on Intel and AMD, and if it causes problems on other x86 > varieties the 0x0004 switch can disable this feature. In this case the > multigenerational LRU suffers a negligible performance degradation. LGTM > > > > > +:Debugfs interface: ``/sys/kernel/debug/lru_gen`` has the following > > > > > > > > Is debugfs interface relevant only for datacenters? > > > > > > For the moment, yes. > > > > And what will happen if somebody uses these interfaces outside > > datacenters? As soon as there is a sysfs intefrace, somebody will surely > > play with it. > > > > I think the job schedulers might be the most important user of that > > interface, but the documentation should not presume it is the only user. > > Other ideas are more like brainstorming than concrete use cases, e.g., > for desktop users, these interface can in theory speed up hibernation > (suspend to disk); for VM users, they can again in theory support auto > ballooning. These niches are really minor and less explored compared > with the data center use cases which have been dominant. > > I was hoping we could focus on the essential and take one step at a > time. Later on, if there is additional demand and resource, then we > expand to cover more use cases. Apparently I was not clear :) I didn't mean that you should describe other use-cases, I rather suggested to make the documentation more neutral, e.g. using "a user writes to this file ..." instead of "job scheduler writes to a file ...". Or maybe add a sentence in the beginning of the "Data centers" section, for instance: Data centers ------------ + A representative example of multigenerational LRU users are job schedulers. Data centers want to optimize job scheduling (bin packing) to improve memory utilizations. Job schedulers need to estimate whether a server -- Sincerely yours, Mike.