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 7605DC433F5 for ; Wed, 23 Feb 2022 21:20:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA7B18D0002; Wed, 23 Feb 2022 16:20:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D59098D0001; Wed, 23 Feb 2022 16:20:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1F1F8D0002; Wed, 23 Feb 2022 16:20:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 98B0A8D0001 for ; Wed, 23 Feb 2022 16:20:45 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4D413E25 for ; Wed, 23 Feb 2022 21:20:45 +0000 (UTC) X-FDA: 79175314050.07.CE1F140 Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) by imf31.hostedemail.com (Postfix) with ESMTP id D38262000B for ; Wed, 23 Feb 2022 21:20:44 +0000 (UTC) Received: by mail-vk1-f177.google.com with SMTP id f12so186997vkl.2 for ; Wed, 23 Feb 2022 13:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ehiyGAnQkCy6/74Qhqw+fB9gBwX1r1I6DWeVnzE/kAc=; b=jXVzrQrxQTZJ8SEAB8dHg+0nEFplAWbQ+OCT9kTLrWig+hlvyzU4sTlRTAmJfueFFk J0f58LKClXd1aqlf9j3xrcwq2we/dKIIvb8SH+ja3KvnDMJyWus/wq5MADouqUyKhTus vFxMFepf4+/S2lrUKmiF23ugTzQU/Gihl/BWpZXC/x7Ngsaf3MYlQXyArXOk9GsOWO2b 3pX+6M+1EDNI1TfrZxeapswN4+5HCdWdsC56+dP/hAf36gXos6PM53IUmqpAw6LWB5Yk myGy0aDP0ZqWclGd4L+i8w2LCamksx5o8kNsJnMQjshI0Gd+ZIGzp9/g39UAwXun5UBf td9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ehiyGAnQkCy6/74Qhqw+fB9gBwX1r1I6DWeVnzE/kAc=; b=QdEtJmn96fQxIKUqBj6cwNfoRVI7boPswDDwffFHvyhLhwdbnfGFr97n6+RTO5KIj5 +hMGoA2jfpCc+CeuWYy73VsBETbBt5+zV7gr88LjhtysX1+lnGHyOLex70p7OAlLFs56 89Fp4BUaUbGlerw4MO+/Drb4YUhB8O1i1RhXvrGS+KyIDy5tcFnzBr99K2ovqz3OXvMc wr37JpkOYIOyHB5yhDyb98eo2PhyCCk77rhgNyS4yjeQr1yr5hMNpK+0DMJozVI5ZerB kOGsE0wO5Sf1L+HClCIXFF80SSnM0q9/LvcZy/cTo5EcniQnhNUwpQOHlHXn+LEsKTh+ LVQg== X-Gm-Message-State: AOAM531EXl+HbpjbI4a0P8Jv2w0ZvmzjWfFEhfswrUqWC+0ZjgHnCvP4 vf1eZ0xUjR1EwdFl7CDCuiSohP9fCZF+pGlFOECJSw== X-Google-Smtp-Source: ABdhPJycZBwQNTcE0ha+OSHu8lSiZ0cx0rPeoyTaaz0gE2xXBd0iR9Fx3cQwbQKM+yd7Al2QUCvsLv65lb2+hYpJMwU= X-Received: by 2002:a05:6122:887:b0:332:699e:7e67 with SMTP id 7-20020a056122088700b00332699e7e67mr717484vkf.35.1645651243803; Wed, 23 Feb 2022 13:20:43 -0800 (PST) MIME-Version: 1.0 References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-13-yuzhao@google.com> In-Reply-To: From: Yu Zhao Date: Wed, 23 Feb 2022 14:20:32 -0700 Message-ID: Subject: Re: [PATCH v7 12/12] mm: multigenerational LRU: documentation To: Mike Rapoport 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 , =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D38262000B X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=jXVzrQrx; spf=pass (imf31.hostedemail.com: domain of yuzhao@google.com designates 209.85.221.177 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: p4kkx5r7t6if43xjf7ps71oqra8qbmtg X-HE-Tag: 1645651244-169285 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 Wed, Feb 23, 2022 at 3:58 AM Mike Rapoport wrote: > > 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 Yes, that makes sense. Will do. Thanks.