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 A002EC64EC4 for ; Wed, 8 Mar 2023 21:32:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 266C36B0071; Wed, 8 Mar 2023 16:32:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EFF36B0072; Wed, 8 Mar 2023 16:32:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 092F76B0074; Wed, 8 Mar 2023 16:32:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EBA1A6B0071 for ; Wed, 8 Mar 2023 16:32:14 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BD420410A2 for ; Wed, 8 Mar 2023 21:32:14 +0000 (UTC) X-FDA: 80547029388.01.7B3E51E Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf19.hostedemail.com (Postfix) with ESMTP id DAF501A000B for ; Wed, 8 Mar 2023 21:32:12 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=YQF4b6dt; spf=pass (imf19.hostedemail.com: domain of yosryahmed@google.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678311133; a=rsa-sha256; cv=none; b=EvT3ETD4NjJY5b1uAjYLjPXAU0wdg6Fdhp5JDX/FR4gq03GooCeT/P41cBfa8s6XkHy7LJ moeYketdXhL+u8Bd1CxbgciUG/T3K31uMucKmGxiS3vou21DGIPzZ2ZXyrbgt92x8Yuu1/ EHeP2gmOabNvkkZ6KrN1nCooBHOqeZ4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=YQF4b6dt; spf=pass (imf19.hostedemail.com: domain of yosryahmed@google.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678311132; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9OhNm7hskoArX04v3EQdnCMnOrwCqQ4hcIfVS+5XDUY=; b=3Tv3tqTz3LXVpjwYFwOHSGdvvbgN+2OeMJh8szDr6lv3szJd+Rco82i3uHJO3ExL2I2Qoh 3xSem0sOM8iMtI7J68gcyeNaDA9w7jWW+pGteYCjX/jX/OTFdhIN/6nKBwqJVtaGE4rt7B Fu6cIKXbhbsKY5JtSgzGfrzJFKbLBQs= Received: by mail-ed1-f41.google.com with SMTP id u9so71410310edd.2 for ; Wed, 08 Mar 2023 13:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678311131; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9OhNm7hskoArX04v3EQdnCMnOrwCqQ4hcIfVS+5XDUY=; b=YQF4b6dt4aLwWSuXkDgEvXikFlVV+90s3I+XXIMWStA2i4jcpOulmSAOGy9o01joWU eL5GVdJG3seI5X51K6vv+G6AfAWp7XYsJr0NPP9UIB/JhzfpRVyS1joOlyUKZA9ua0CV 0AlwdGzA81Xmx4twweFoOeHWYIkUmS4Y/0DCxzaNjWAm4mPp1uM4ruAlBxbkDfxb7915 BVF7TCTAcPcYih2XWDnXE9gwH0C9Y/e2VXwl0sm6xLDChFUTZ6mE8zX34y2NKUF+0+2n M3KWjt3lfciV48/K8q1G5gzqPKRNjToIYqyRjNGhrcCWKi8EMmg0cEd7pb1q4yHnkI7p SGIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311131; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9OhNm7hskoArX04v3EQdnCMnOrwCqQ4hcIfVS+5XDUY=; b=5UaVe/ScTovekjDyVuyRvDXA8xHJ66DHSoGa8Qza6G1frHo8D8lOr116AnsHji6i7b Tfz3jACCRup5SrnvZDdYXKMiRMtTcNlc65vHl0vZuNBgJ3g7/A6xJ83bsUZ3v9b95BQz Bt1n7FGD2XIBVaPVecC8z2kOATBlqhEMifNLM1dDJX9+jpRcx+oFFvM5lfIPnJmF8jAy AYdREbxG91WUbddJUldGv5tg8g2JbpoCDjAwdCLsemcdXsblsZcVD9QYSL5iHu1bx0Ap 6IvWzXZ7ptnG4WVpWl+SNzwVb/A7VlyMZBDJK8SZTpP1qsuF8B9u3u7MRJ7MzoRinn4K O3qw== X-Gm-Message-State: AO0yUKVOa684vzrM4u45/YDpaOfqGQI3CZljgq8jEh7ud2pFBoDdk8RH bqVMV/CsWTdWCxCQSf+KWr61Jn2DTFWE+5lJ44MRuw== X-Google-Smtp-Source: AK7set/PzfqhJ3GbqSiCxOuRaMNXqhDvbTag8Kp4p5tLkGOC6kLRGrUY5OGxaaNPJqqxdTrX1oWnqGTKOPNp73maa0k= X-Received: by 2002:a17:906:d7a6:b0:914:373:14de with SMTP id pk6-20020a170906d7a600b00914037314demr5329825ejb.10.1678311131118; Wed, 08 Mar 2023 13:32:11 -0800 (PST) MIME-Version: 1.0 References: <20230228085002.2592473-1-yosryahmed@google.com> <20230308160056.GA414058@cmpxchg.org> <20230308201629.GB476158@cmpxchg.org> <20230308212529.GL360264@dread.disaster.area> In-Reply-To: <20230308212529.GL360264@dread.disaster.area> From: Yosry Ahmed Date: Wed, 8 Mar 2023 13:31:34 -0800 Message-ID: Subject: Re: [PATCH v1 0/2] Ignore non-LRU-based reclaim in memcg reclaim To: Dave Chinner Cc: Johannes Weiner , Alexander Viro , "Darrick J. Wong" , Christoph Lameter , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, "Matthew Wilcox (Oracle)" , Miaohe Lin , David Hildenbrand , Peter Xu , NeilBrown , Shakeel Butt , Michal Hocko , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: DAF501A000B X-Rspamd-Server: rspam01 X-Stat-Signature: a696xajg9qr716ogtqk7tx8wih9j7cat X-HE-Tag: 1678311132-321782 X-HE-Meta: U2FsdGVkX1/8mV05A7uE7lXZEFKXjmES2lIILReNe2oT/OgR5qwAp3kRZ75yb5LR8Zjm0D1Oeit0xaKVdqq+/tPnydzkQXSM/zD4Ut1+n5SrLgts1X52g9yX0r6KXNSUb8Trd7A6zlduCxhWSfl86Qm0SVlapZNo1hnbRqHG900L26BaMCK+2zMB5s9cFp7eGwvdNCqxcWQQElOMfImMu1o8JdlgxBFi6bddDv08WtSZ0o9Ex+0Qrfqtz/erCyXWTPzkNQyyWQWTzzHLBgQTrOMWSTUtkoEkn3M8eO4K/RXMQlAkp2+2EKqZ8ayU80DL3VEaPb8em4gZVLVfi28/nGNCDLhgiS5KQWjzic1cKR0tY6GkEu+ZpoVNG524WVia+5mmJcrDhLBfbUVdeOATYmOXa5FEaDbl+4Oj3Gdh0gQYiRTc3UbPc3zYXZUzUu4aIk695Pb3H+5KCbYg/UEyB9YbnOmO0LpMO+Qw/WumT7zSMEcidyTBbyQPMqWTXti5aGBhsFdYH/sjSP8mkztRHIy9kWi8oVcKN3evzKNt0U5BcjSWSW64RTTjL+m4SFcmhMb2ckK0bCNu2Ms2BvWIZR3rRx6Ays01BIJbBiH6oU8JKHSUXhJaakd5AVB7xn5t2C//xDgSLCZxcNvPE4Q1sG/A9ee7rkhMH9um7Gwfhb6K8NOqjG9ngWQk/X8JPbMd5iR0qTbrwBLXSxA8EOB22ytcp5jqgEqhgGQpJcEUaisN96XavYlmap/LQAXc3/C495qo3tUZ4GeCspohkqNr7akUcbLqjQ5WvINtCSK3KV4TxTyNWjEHhSG3s9ykRQhcBkrFFugbSfeyZTsF5jX6S961ZtgfaYnQ0zqr3TqgwQD8XV6BsagyGXqwK/2dSKlGqfE0UXJdEwPaDUAHc0OOBm6n9X3bftC9A9asFhcXh75ELfNTn7RuXCtBMDamX7TdVC49PuJM8cGDHtwjGbo clVAywng rK7AAJoWYa5iOVCJkN507gjVwGZxfkIF+4oEd7yfQ6MQ7lmiTbrODu/9vgghMz9Gkw653usbI1cUXwygWwCpHcPjmWLLhjBxawSZEMcdz2XjUP5iIA/1BoI2Lky1x5mO9EV8MPILG6yffd4oS0t89nS+KLR3l7vMIyAHBMGxHF/T7iVf4RmyaGt1+rQ+/1iIoSQv/zmm9y+vr2QFaGqaCbfdrxDFjW1EjlVg5JmxudMY02muDqmtnU5jueUnSKOV8U3M765rh5q51yYu6EOwBqNoBRnlW1QJRE7aLUuyNNlzFSBUIC4PaWnq8J+kjDSZA6JnuNNi/PADPYBxxzXB6AKHn7RO7duNoDkdcd5LcNC+ku4aCczFcVp80hw== 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, Mar 8, 2023 at 1:25=E2=80=AFPM Dave Chinner w= rote: > > On Wed, Mar 08, 2023 at 12:24:08PM -0800, Yosry Ahmed wrote: > > > I tried to come up with something better, but wasn't happy with any o= f > > > the options, either. So I defaulted to just leaving it alone :-) > > > > > > It's part of the shrinker API and the name hasn't changed since the > > > initial git import of the kernel tree. It should be fine, churn-wise. > > > > Last attempt, just update_reclaim_state() (corresponding to > > flush_reclaim_state() below). It doesn't tell a story, but neither > > does incrementing a counter in current->reclaim_state. If that doesn't > > make you happy I'll give up now and leave it as-is :) > > This is used in different subsystem shrinkers outside mm/, so the > name needs to be correctly namespaced. Please prefix it with the > subsystem the function belongs to, at minimum. > > mm_account_reclaimed_pages() is what is actually being done here. > It is self describing and leaves behind no ambiguity as to what is > being accounted and why, nor which subsystem the accounting belongs > to. > > It doesn't matter what the internal mm/vmscan structures are called, > all we care about is telling the mm infrastructure how many extra > pages were freed by the shrinker.... mm_account_reclaimed_pages() sounds good to me. We can also do something more specific if Johannes has any ideas. I do not have a strong opinion here at all, I just prefer having a helper to leaving it open-coded. Thanks! > > -Dave. > -- > Dave Chinner > david@fromorbit.com