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 1ED1EC05027 for ; Fri, 3 Feb 2023 22:31:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233097AbjBCWbX (ORCPT ); Fri, 3 Feb 2023 17:31:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbjBCWbV (ORCPT ); Fri, 3 Feb 2023 17:31:21 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 778C2184 for ; Fri, 3 Feb 2023 14:31:19 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id lu11so19330473ejb.3 for ; Fri, 03 Feb 2023 14:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dWWZZt8Kd4jgexM3P2TiZQc8VKtIMzPQG+XBMGoXd3A=; b=KAaaQyjPGwK5bqIhRr/0vsX0mK/cllOocnrd3InMcbq4UNsMPH1EAzHpj8k0DULfrU LYeN9IuTZZ9KunpCXqpNhekp1fgZqmzx0V/QSjn6LccSZhKmUuVjz9zwJ2g8gLLyGGy3 tcYLvcuNXZZEpSvrQBRUDtmDAGF0958HA1yJotBPrUuJZqSA/tlwjPNwgO5fSfAiPM9P wlfJbx5VPi7Hdgerg+cet3bseBQsyi2WNDLbb5zCzh/xjuGdpAeAWS+IKsqvoEB6WsCK nTaOW9nT3V3BCJekQVJL8dHPe1q4Jo2TTriZYQB+IHe0PdZFa1oQ4p4N3UkM0IV8yHik oXAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=dWWZZt8Kd4jgexM3P2TiZQc8VKtIMzPQG+XBMGoXd3A=; b=fqRqHfVsh3dEuh6rsimzoNlZrqg6n1Zj9IdDaJKrPNk3Yy8haoEIt/YM3JKfLrsucG UgI1tFws2megHBwqD20Auc67twTPCmCk58HWrZW0EnHBMkge4VZ3opMnHMYSh/EX611R pg3ddgJOh6lJQrKKuEb8VihMjFOfs7MK7LJqi1Gs+Tk9XiFMHrtS2i6l72rJrypmPdlx +Z5iAi8V+JAIte5eW3ikx7copksRQy0QM8gT6T90fNc+Hi35MzuaUEItBcUIKTK7omcK 0VOI2J62wrACQbc3AI6GjYhHAysF9X3X7AKDz9YNaL+h2ytoW1B9BPuRlTBysMIBaMJv p0OA== X-Gm-Message-State: AO0yUKUiEiPJmTjDanSJmsBiyMe2ZjVwPcaiSaqDQtXOJKE8MrFhvG9G 3A04fdbjWvr62VF7R06couvIIAE08R9w71EI/8DXqw== X-Google-Smtp-Source: AK7set/ngCUt3CFIMK1ZEA00e8oy4dFzGJAM1H1PmSx4A9FBTa8WDKIPnYAqeI3LGjP/KCfjZut7Hqka4SW9V2e2hvU= X-Received: by 2002:a17:906:c319:b0:878:7bc7:958a with SMTP id s25-20020a170906c31900b008787bc7958amr3493108ejz.220.1675463477828; Fri, 03 Feb 2023 14:31:17 -0800 (PST) MIME-Version: 1.0 References: <20230202233229.3895713-1-yosryahmed@google.com> <20230202233229.3895713-2-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Fri, 3 Feb 2023 14:30:41 -0800 Message-ID: Subject: Re: [RFC PATCH v1 1/2] mm: vmscan: refactor updating reclaimed pages in reclaim_state To: Matthew Wilcox Cc: Alexander Viro , "Darrick J. Wong" , Christoph Lameter , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Miaohe Lin , David Hildenbrand , Johannes Weiner , 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 3, 2023 at 8:22 AM Matthew Wilcox wrote: > > On Thu, Feb 02, 2023 at 11:32:28PM +0000, Yosry Ahmed wrote: > > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c > > index 54c774af6e1c..060079f1e966 100644 > > --- a/fs/xfs/xfs_buf.c > > +++ b/fs/xfs/xfs_buf.c > > @@ -286,8 +286,7 @@ xfs_buf_free_pages( > > if (bp->b_pages[i]) > > __free_page(bp->b_pages[i]); > > } > > - if (current->reclaim_state) > > - current->reclaim_state->reclaimed_slab += bp->b_page_count; > > + report_freed_pages(bp->b_page_count); > > XFS can be built as a module I didn't know that, thanks for pointing it out! > > > +++ b/mm/vmscan.c > > @@ -204,6 +204,19 @@ static void set_task_reclaim_state(struct task_struct *task, > > task->reclaim_state = rs; > > } > > > > +/* > > + * reclaim_report_freed_pages: report pages freed outside of LRU-based reclaim > > + * @pages: number of pages freed > > + * > > + * If the current process is undergoing a reclaim operation, > > + * increment the number of reclaimed pages by @pages. > > + */ > > +void report_freed_pages(unsigned long pages) > > +{ > > + if (current->reclaim_state) > > + current->reclaim_state->reclaimed += pages; > > +} > > + > > report_free_pages is not EXPORT_SYMBOLed Will do that for the next version, thanks!