linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-fsdevel@vger.kernel.org, amir73il@gmail.com,
	miklos@szeredi.hu,  bschubert@ddn.com
Subject: Re: [PATCH 09/11] fuse: use the folio based vmstat helpers
Date: Tue, 27 Aug 2024 15:05:06 -0700	[thread overview]
Message-ID: <CAJnrk1au0FGiGu3Nea7M+jstTgPOns5Tg7iDhzyGNrPerUbfQg@mail.gmail.com> (raw)
In-Reply-To: <d3cc890dfeefcd79d0217c7f1aab7debe604b395.1724791233.git.josef@toxicpanda.com>

On Tue, Aug 27, 2024 at 1:46 PM Josef Bacik <josef@toxicpanda.com> wrote:
>
> In order to make it easier to switch to folios in the fuse_args_pages
> update the places where we update the vmstat counters for writeback to
> use the folio related helpers.  On the inc side this is easy as we
> already have the folio, on the dec side we have to page_folio() the
> pages for now.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

LGTM.

Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
> ---
>  fs/fuse/file.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 3ef6c2f58940..e03b915d8229 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1853,12 +1853,12 @@ static void fuse_writepage_free(struct fuse_writepage_args *wpa)
>         kfree(wpa);
>  }
>
> -static void fuse_writepage_finish_stat(struct inode *inode, struct page *page)
> +static void fuse_writepage_finish_stat(struct inode *inode, struct folio *folio)
>  {
>         struct backing_dev_info *bdi = inode_to_bdi(inode);
>
>         dec_wb_stat(&bdi->wb, WB_WRITEBACK);
> -       dec_node_page_state(page, NR_WRITEBACK_TEMP);
> +       node_stat_sub_folio(folio, NR_WRITEBACK_TEMP);
>         wb_writeout_inc(&bdi->wb);
>  }
>
> @@ -1870,7 +1870,7 @@ static void fuse_writepage_finish(struct fuse_writepage_args *wpa)
>         int i;
>
>         for (i = 0; i < ap->num_pages; i++)
> -               fuse_writepage_finish_stat(inode, ap->pages[i]);
> +               fuse_writepage_finish_stat(inode, page_folio(ap->pages[i]));
>
>         wake_up(&fi->page_waitq);
>  }
> @@ -1925,7 +1925,8 @@ __acquires(fi->lock)
>         for (aux = wpa->next; aux; aux = next) {
>                 next = aux->next;
>                 aux->next = NULL;
> -               fuse_writepage_finish_stat(aux->inode, aux->ia.ap.pages[0]);
> +               fuse_writepage_finish_stat(aux->inode,
> +                                          page_folio(aux->ia.ap.pages[0]));
>                 fuse_writepage_free(aux);
>         }
>
> @@ -2145,7 +2146,7 @@ static void fuse_writepage_args_page_fill(struct fuse_writepage_args *wpa, struc
>         ap->descs[page_index].length = PAGE_SIZE;
>
>         inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK);
> -       inc_node_page_state(&tmp_folio->page, NR_WRITEBACK_TEMP);
> +       node_stat_add_folio(tmp_folio, NR_WRITEBACK_TEMP);
>  }
>
>  static struct fuse_writepage_args *fuse_writepage_args_setup(struct folio *folio,
> @@ -2319,7 +2320,8 @@ static bool fuse_writepage_add(struct fuse_writepage_args *new_wpa,
>         spin_unlock(&fi->lock);
>
>         if (tmp) {
> -               fuse_writepage_finish_stat(new_wpa->inode, new_ap->pages[0]);
> +               fuse_writepage_finish_stat(new_wpa->inode,
> +                                          page_folio(new_ap->pages[0]));
>                 fuse_writepage_free(new_wpa);
>         }
>
> --
> 2.43.0
>

  reply	other threads:[~2024-08-27 22:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 20:45 [PATCH 00/11] fuse: convert to using folios and iomap Josef Bacik
2024-08-27 20:45 ` [PATCH 01/11] fuse: convert readahead to use folios Josef Bacik
2024-08-27 21:46   ` Matthew Wilcox
2024-08-27 22:23     ` Josef Bacik
2024-08-27 20:45 ` [PATCH 02/11] fuse: convert fuse_send_write_pages " Josef Bacik
2024-08-27 21:53   ` Matthew Wilcox
2024-08-27 22:24     ` Josef Bacik
2024-08-27 20:45 ` [PATCH 03/11] fuse: convert fuse_fill_write_pages " Josef Bacik
2024-08-27 21:30   ` Joanne Koong
2024-08-27 22:25     ` Josef Bacik
2024-08-27 20:45 ` [PATCH 04/11] fuse: convert fuse_page_mkwrite " Josef Bacik
2024-08-27 20:45 ` [PATCH 05/11] fuse: use kiocb_modified in buffered write path Josef Bacik
2024-08-27 20:45 ` [PATCH 06/11] fuse: use iomap for writeback cache buffered writes Josef Bacik
2024-08-28  5:16   ` Christoph Hellwig
2024-08-27 20:45 ` [PATCH 07/11] fuse: convert fuse_do_readpage to use folios Josef Bacik
2024-08-27 20:45 ` [PATCH 08/11] fuse: convert fuse_writepage_need_send to take a folio Josef Bacik
2024-08-27 20:45 ` [PATCH 09/11] fuse: use the folio based vmstat helpers Josef Bacik
2024-08-27 22:05   ` Joanne Koong [this message]
2024-08-27 20:45 ` [PATCH 10/11] fuse: convert fuse_retrieve to use folios Josef Bacik
2024-08-27 22:10   ` Joanne Koong
2024-08-27 20:45 ` [PATCH 11/11] fuse: convert fuse_notify_store " Josef Bacik
2024-08-27 21:36 ` [PATCH 00/11] fuse: convert to using folios and iomap Bernd Schubert
2024-08-27 22:18   ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJnrk1au0FGiGu3Nea7M+jstTgPOns5Tg7iDhzyGNrPerUbfQg@mail.gmail.com \
    --to=joannelkoong@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=bschubert@ddn.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).