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 BBF69C433EF for ; Tue, 26 Apr 2022 22:16:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D63146B0074; Tue, 26 Apr 2022 18:16:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D108F6B0075; Tue, 26 Apr 2022 18:16:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB0D36B0078; Tue, 26 Apr 2022 18:16:05 -0400 (EDT) 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 AB55B6B0074 for ; Tue, 26 Apr 2022 18:16:05 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 8783B60EBC for ; Tue, 26 Apr 2022 22:16:05 +0000 (UTC) X-FDA: 79400439090.10.8404DB6 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by imf29.hostedemail.com (Postfix) with ESMTP id 68812120059 for ; Tue, 26 Apr 2022 22:16:02 +0000 (UTC) Received: by mail-vs1-f48.google.com with SMTP id d2so95623vsd.12 for ; Tue, 26 Apr 2022 15:16:04 -0700 (PDT) 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=6zGXmfev2fZGrOwPRRRskiATCBJI4+jYm998S3ATC8Q=; b=SspT/Gc1YeBYxd3CDjgccU2KIlthHvbpi3ELpC1/z6AtxsRSGcDqwaIGXTajqWv35R U60ZsfoDh1/7M4TIEPZB6asL2txtS5ml4OIggIpTnfg+6k72xgPyg8qlqtC3uIn63Sc/ 4YzjlF0Z54wBRglXo5yjakB8gPaoRQFvWL76oA5kdOQJ+eVZg2eGyFwCrwCvW2yJZD1b IPYK9K59RGTw+qyLe8gQvRFAcHt47psGBWruCznn4BB9YGpIVHNQ886qej50GZAN/4Ly na8F3eaEjgkDsk2VBWT/Oggkhho04df+tjjUZCswqQ/sqs0022L0tNQmX8FdAAINcDF+ Yhrg== 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=6zGXmfev2fZGrOwPRRRskiATCBJI4+jYm998S3ATC8Q=; b=Rx04zBHTQeVrYkqamJPBlzLYf0ct+rIBJHh9zYxoHZ8LxPGJWz0wBIzshulGbeUBqP Pvynf17n9IasEiXnHAa/GPCRsC1F7SX/GB8remyur7YjyywGKmbJYfsM8HXzf6rfehbD L0CX42Xz/Nhgd/Mphl6VK2De0ev0aVdVN0QaciRYWNrGFQclIkTEF6sNGbcyR3imzZzI GXOMPF/ScMj+ipP+RDz5d1FPK+zcdGWhMRoRVxU5vjLbGE8yCwF/j/uxeM3aSQQ5Hp3d Lj0hFx8V2Q7rAWp5ReGkMALWB+mgX9XCeh7fmlzs/mzPVpEcMSmcktKdNTQ7aGLLcNoE XWwg== X-Gm-Message-State: AOAM531GJSSxbz2Y7ukrmEAttXQyT+eLJMjTgyP3eJ6SXxVvaBoaABXX 6BWxnuxh/p8K56KGQXuGwo3qrZxz+Jn90LNsXUirKg== X-Google-Smtp-Source: ABdhPJwtXIjGlv7qMVkp8DMl5ITZo9rPEtcBPeYIWRka13ZludUdH/JfX3XZPzMGGhjISchzL8DHf+KslyvYgkO1+v8= X-Received: by 2002:a67:cfc5:0:b0:32c:d143:d8e9 with SMTP id h5-20020a67cfc5000000b0032cd143d8e9mr3404761vsm.22.1651011363983; Tue, 26 Apr 2022 15:16:03 -0700 (PDT) MIME-Version: 1.0 References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-13-yuzhao@google.com> <20220411191634.674554d3de2ba37b3db40ca2@linux-foundation.org> <20220415212024.c682ac000e3e91572d8d6d2b@linux-foundation.org> <20220426143034.f520c062830f9e3405c890d0@linux-foundation.org> In-Reply-To: <20220426143034.f520c062830f9e3405c890d0@linux-foundation.org> From: Yu Zhao Date: Tue, 26 Apr 2022 16:15:26 -0600 Message-ID: Subject: Re: [PATCH v10 12/14] mm: multi-gen LRU: debugfs interface To: Andrew Morton Cc: Stephen Rothwell , Linux-MM , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , 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 , Vaibhav Jain Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="SspT/Gc1"; spf=pass (imf29.hostedemail.com: domain of yuzhao@google.com designates 209.85.217.48 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 68812120059 X-Stat-Signature: f88dkyazk4a38fwsdy9xu8o9i55ast6a X-HE-Tag: 1651011362-722312 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 Tue, Apr 26, 2022 at 3:30 PM Andrew Morton wrote: > > On Tue, 26 Apr 2022 00:59:37 -0600 Yu Zhao wrote: > > > On Fri, Apr 15, 2022 at 10:20 PM Andrew Morton > > wrote: > > > > > > On Fri, 15 Apr 2022 18:03:16 -0600 Yu Zhao wrote: > > > > > > > > Presumably sysfs is the place. Fully documented and with usage > > > > > examples in the changelog so we can carefully review the proposed > > > > > extensions to Linux's ABI. Extensions which must be maintained > > > > > unchanged for all time. > > > > > > > > Eventually, yes. There still is a long way to go. Rest assured, this > > > > is something Google will keep investing resources on. > > > > > > So. The plan is to put these interfaces in debugfs for now, with a > > > view to migrating stabilized interfaces into sysfs (or procfs or > > > whatever) once end-user requirements and use cases are better > > > understood? > > > > The requirements are well understood and the use cases are proven, > > e.g., Google [1], Meta [2] and Alibaba [3]. > > > > [1] https://dl.acm.org/doi/10.1145/3297858.3304053 > > [2] https://dl.acm.org/doi/10.1145/3503222.3507731 > > [3] https://gitee.com/anolis/cloud-kernel/blob/release-5.10/mm/kidled.c > > So will these interfaces be moved into sysfs? So the debugfs interface from this patch provides: 1. proactive reclaim, 2. working set estimation. The sysfs interface for item 1 is being finalized by [4], and it's a subset of this debugfs interface because we want it to be more general. The sysfs interface for item 2 will be eventually proposed as well, with the same approach. It will look like a histogram in which the active/inactive LRU has two bins whereas MGLRU has more bins. Bins contain pages and multiple bins represent different hotness/coldness. Since [4] took about two years, I'd say this histogram-like interface would take no less than a couple of years as well. This debugfs interface stays even after that, and it will serve its true purpose (debugging), not a substitute for the sysfs interfaces. > > > If so, that sounds totally great to me. But it should have been in > > > the darn changelog! This is the sort of thing which we care about most > > > keenly. > > > > > > It would be helpful for reviewers to understand the proposed timeline > > > for this process, because the entire feature isn't really real until > > > this is completed, is it? I do think we should get this nailed down > > > relatively rapidly, otherwise people will be reluctant to invest much > > > into a moving target. > > > > > > And I must say, I see dissonance between the overall maturity of the > > > feature as described in these emails versus the immaturity of these > > > userspace control interfaces. What's happening there? > > > > Very observant. To answer both of the questions above: each iteration > > of the entire stack is a multi-year effort. > > > > Given its ROI, companies I know of constantly pour money into this > > area. Given its scale, this debugfs is the least of their concerns. A > > good example is the proactive reclaim sysfs interface [4]. It's been > > used at Google for many years and at Meta for a few years. We only > > started finalizing it recently. > > > > [4] https://lore.kernel.org/r/20220425190040.2475377-1-yosryahmed@google.com/ > > Sure, if one organization is involved in both the userspace code and > the kernel interfaces then the alteration of kernel interfaces can be > handled in a coordinated fashion. > > But releasing interfaces to the whole world is a different deal. It's > acceptable to say "this is in debugfs for now because it's a work > in progress" but it sounds like mglru's interfaces are beyond that > stage? Correct. It's a WIP in the sense of "know what needs to be done but can't get it done immediately", not "don't know what's next; try this for now".