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 A7FF0C64EC4 for ; Thu, 9 Mar 2023 04:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjCIEI3 (ORCPT ); Wed, 8 Mar 2023 23:08:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjCIEIZ (ORCPT ); Wed, 8 Mar 2023 23:08:25 -0500 Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D1030B17 for ; Wed, 8 Mar 2023 20:08:22 -0800 (PST) Received: by mail-qv1-xf2b.google.com with SMTP id nv15so654513qvb.7 for ; Wed, 08 Mar 2023 20:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; t=1678334901; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KOqFTH5u/fVVsKVxp4qKRwo0vsAjcMeltzSVwR+wC7w=; b=QR3kDqRboFFNYKkzTvJrai95dT3dZTs9cGDwwec8U7dvf/bHtU8JEPYSUNwNi/A46B gBI203InsTfsnZw9Bv6K1Tq2dpzCPmP9irezZNzKvopRnWuhHByck3EjMdnV8UYvu0MF pkOF6VyERI42m0XRvCUT7r3ELRx0whQS1NVs41INaHDKAHjqKKYfZ+5LCMR0HTol4O4c 5ZhWDegnCqEQx6vHB0EVkpKmVt+qAJQ3GFLh1WwsqiXGzwYR7AR9t1UhDO9N9doLFdtd OCVBDqZ45fI2Bac3OyAY6RRjSMFpgAXGdNxKPvkbVt02jFWGaIMcLg4vJO1MbhB/sBZt Qliw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678334901; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KOqFTH5u/fVVsKVxp4qKRwo0vsAjcMeltzSVwR+wC7w=; b=Pxm+FNvuKJnitrgQZ0KNDta+iCYI9MbS0kmtiFuMoj36vaMyvDaDF0Z1IdLpLidNkE SS1lPZPlDbkxFzZX13he/JH/MEC9W0PwLwUbHZc1NM6qOCa3bkj3Zu9mSDzs4N5GLy+V r3sMhbU4U2bdzoHO3H4ss9lW9LuRWEz04rSNUJffmTyxeMRQy/8UAJrvIThhXA+X6THr 86ILypT3c21X+QLwXqvKKNAYyQbWpnIsUMu3zwWqV7TCANFYsD/C6w/cB24pD+SXsL63 GBU1D6w8Oj/dcCYpyfgl9M28ICEqFSsh0vujVBoRTXstpHWPGl0PTZlZ8940UNaDwIcg ylwg== X-Gm-Message-State: AO0yUKV2MbbxxiHztzW6vIHmWHw5DB9oeIE4KomJguD4hvVq3Gof8zpY NIxWYPgZpznfPzVIJa+ppIaxLw== X-Google-Smtp-Source: AK7set+r5PhASkThXPj+BSSKPFPWT2nq8eT+XeY2DnDOIzh5J3uIhZ9LayYCBBwqIwSzebzHBCuiOg== X-Received: by 2002:a05:6214:518f:b0:56e:aa11:da91 with SMTP id kl15-20020a056214518f00b0056eaa11da91mr2203393qvb.14.1678334901632; Wed, 08 Mar 2023 20:08:21 -0800 (PST) Received: from localhost ([2620:10d:c091:400::5:d32c]) by smtp.gmail.com with ESMTPSA id r8-20020ae9d608000000b006f9f3c0c63csm12698858qkk.32.2023.03.08.20.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 20:08:21 -0800 (PST) Date: Wed, 8 Mar 2023 23:08:20 -0500 From: Johannes Weiner To: Dave Chinner Cc: Yosry Ahmed , 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 Subject: Re: [PATCH v1 0/2] Ignore non-LRU-based reclaim in memcg reclaim Message-ID: <20230309040820.GC476158@cmpxchg.org> References: <20230228085002.2592473-1-yosryahmed@google.com> <20230308160056.GA414058@cmpxchg.org> <20230308201629.GB476158@cmpxchg.org> <20230308212529.GL360264@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230308212529.GL360264@dread.disaster.area> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 09, 2023 at 08:25:29AM +1100, Dave Chinner wrote: > 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 of > > > 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.... My first preference would still be to just leave it. IMO that one line saved in a small handful of places isn't worth the indirection, obscuring the `current' deref etc. But mm_account_reclaimed_pages() works for me if you really want to enapsulate it.