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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98E22C433F5 for ; Wed, 23 Feb 2022 10:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239740AbiBWK7O (ORCPT ); Wed, 23 Feb 2022 05:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbiBWK7N (ORCPT ); Wed, 23 Feb 2022 05:59:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C711C8BF5E; Wed, 23 Feb 2022 02:58:45 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5CBCE617B9; 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D4E5C433EF for ; Wed, 23 Feb 2022 11:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ykyfPjK5bQL79IbOqzch1/8Wd726QoFUarNvdmzCMqI=; b=d/zqwR0wobuyh+ 6Iys65ccbWvaphh6kVBbulAP2lm7j9Is/7SKtQceYPsKk6AkYoqx4HV4/J2GW/9/5wbRKfi6YAWs4 hvv2dvVXtlHEHQLVqTsLfGUgtwobPXHRJHdviR/72Dg0iTeQe1//1kf7qI1JSc+6pocK4P862Nz2b T2mSORYTjEH1nWY83YRh9GRFe30SABkdNK+3sSTrA7BW9ieFhRb6Bg4D0zXxJBGRbMMOYvs7OfKkq rSScxpk1XKQSL64YW4Sqvm4rl3EjgY+IY1WNOKaBfrpG89h/aA7+2f3mdf3UnWLS1lzwhwwCdXmsr AWXOt6eA26aWbUziQIVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMpMH-00DmRn-O1; Wed, 23 Feb 2022 10:58:57 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMpM7-00DmNw-UO for linux-arm-kernel@lists.infradead.org; Wed, 23 Feb 2022 10:58:55 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220223_025848_316183_2BF61B34 X-CRM114-Status: GOOD ( 41.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel