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: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
	 bernd.schubert@fastmail.fm, willy@infradead.org,
	kernel-team@meta.com
Subject: Re: [PATCH 11/13] mm/writeback: add folio_mark_dirty_lock()
Date: Tue, 22 Oct 2024 11:05:58 -0700	[thread overview]
Message-ID: <CAJnrk1ZR4O++NBRhwzEw6GdpuxNDxGVW=dMYOvuZ-CyQP83iwA@mail.gmail.com> (raw)
In-Reply-To: <20241018200139.GB2473677@perftesting>

On Fri, Oct 18, 2024 at 1:01 PM Josef Bacik <josef@toxicpanda.com> wrote:
>
> On Wed, Oct 02, 2024 at 09:52:51AM -0700, Joanne Koong wrote:
> > Add a new convenience helper folio_mark_dirty_lock() that grabs the
> > folio lock before calling folio_mark_dirty().
> >
> > Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> > ---
> >  include/linux/mm.h  |  1 +
> >  mm/page-writeback.c | 12 ++++++++++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index ecf63d2b0582..446d7096c48f 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -2539,6 +2539,7 @@ struct kvec;
> >  struct page *get_dump_page(unsigned long addr);
> >
> >  bool folio_mark_dirty(struct folio *folio);
> > +bool folio_mark_dirty_lock(struct folio *folio);
> >  bool set_page_dirty(struct page *page);
> >  int set_page_dirty_lock(struct page *page);
> >
> > diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> > index fcd4c1439cb9..9b1c95dd219c 100644
> > --- a/mm/page-writeback.c
> > +++ b/mm/page-writeback.c
> > @@ -2913,6 +2913,18 @@ bool folio_mark_dirty(struct folio *folio)
> >  }
> >  EXPORT_SYMBOL(folio_mark_dirty);
> >
>
> I think you should include the comment description from set_page_dirty_lock() as
> well here, generally good to keep documentation consistent.  Thanks,

Looking at this some more, for v2 I am going to replace
set_page_dirty_lock() to be a wrapper around folio_mark_dirty_lock(),
eg something like

+int set_page_dirty_lock(struct page *page)
+{
+       return folio_mark_dirty_lock(page_folio(page));
+}
+EXPORT_SYMBOL(set_page_dirty_lock);

so that we have one source of truth for the logic. I'll remove your
Reviewed-by for this patch in v2 in case you have disagreements on the
newer v2 implementation.


Thanks,
Joanne

>
> Josef

  reply	other threads:[~2024-10-22 18:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 16:52 [PATCH 00/13] fuse: use folios instead of pages for requests Joanne Koong
2024-10-02 16:52 ` [PATCH 01/13] fuse: support folios in struct fuse_args_pages and fuse_copy_pages() Joanne Koong
2024-10-18 19:48   ` Josef Bacik
2024-10-02 16:52 ` [PATCH 02/13] fuse: add support in virtio for requests using folios Joanne Koong
2024-10-02 16:52 ` [PATCH 03/13] fuse: convert cuse to use folios Joanne Koong
2024-10-02 16:52 ` [PATCH 04/13] fuse: convert readlink " Joanne Koong
2024-10-02 16:52 ` [PATCH 05/13] fuse: convert readdir " Joanne Koong
2024-10-02 16:52 ` [PATCH 06/13] fuse: convert reads " Joanne Koong
2024-10-02 16:52 ` [PATCH 07/13] fuse: convert writes (non-writeback) " Joanne Koong
2024-10-02 16:52 ` [PATCH 08/13] fuse: convert ioctls " Joanne Koong
2024-10-02 16:52 ` [PATCH 09/13] fuse: convert retrieves " Joanne Koong
2024-10-02 16:52 ` [PATCH 10/13] fuse: convert writebacks " Joanne Koong
2024-10-02 16:52 ` [PATCH 11/13] mm/writeback: add folio_mark_dirty_lock() Joanne Koong
2024-10-18 20:01   ` Josef Bacik
2024-10-22 18:05     ` Joanne Koong [this message]
2024-10-02 16:52 ` [PATCH 12/13] fuse: convert direct io to use folios Joanne Koong
2024-10-18 20:02   ` Josef Bacik
2024-10-21 22:02     ` Joanne Koong
2024-10-02 16:52 ` [PATCH 13/13] fuse: remove pages for requests and exclusively " Joanne Koong
2024-10-18 20:07 ` [PATCH 00/13] fuse: use folios instead of pages for requests 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='CAJnrk1ZR4O++NBRhwzEw6GdpuxNDxGVW=dMYOvuZ-CyQP83iwA@mail.gmail.com' \
    --to=joannelkoong@gmail.com \
    --cc=bernd.schubert@fastmail.fm \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=willy@infradead.org \
    /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).