linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org
Subject: Re: Splitting dirty fs folios
Date: Mon, 29 May 2023 23:44:49 +0100	[thread overview]
Message-ID: <ZHUq4UrM7+wM0lYu@casper.infradead.org> (raw)
In-Reply-To: <ZHUppPtjIjXVsacC@dread.disaster.area>

On Tue, May 30, 2023 at 08:39:32AM +1000, Dave Chinner wrote:
> > Option 5: If the folio is both dirty and !uptodate, just refuse to split
> > it, like if somebody else had a reference on it.  A less extreme version
> > of #4.
> 
> Also seems like a reasonable first step.
> 
> > I may have missed some other option.  Option 5 seems like the least
> > amount of work.
> 
> *nod*
> 
> Overall, I think the best way to approach it is to do the simplest,
> most obviously correct thing first. If/when we observe performance
> problems from the simple approach, then we can decide how to solve
> that via one of the more complex approaches...

So the good news is that Option 5 seems to have no regressions and
the functional part of the patch looks like ...

+++ b/fs/iomap/buffered-io.c
@@ -510,11 +510,6 @@ void iomap_invalidate_folio(struct folio *folio, size_t off
set, size_t len)
                WARN_ON_ONCE(folio_test_writeback(folio));
                folio_cancel_dirty(folio);
                iomap_page_release(folio);
-       } else if (folio_test_large(folio)) {
-               /* Must release the iop so the page can be split */
-               VM_WARN_ON_ONCE_FOLIO(!folio_test_uptodate(folio) &&
-                               folio_test_dirty(folio), folio);
-               iomap_page_release(folio);
        }
 }
 EXPORT_SYMBOL_GPL(iomap_invalidate_folio);

I need to modify a few comments and document exactly why this works,
but it seems like a good next step.

      reply	other threads:[~2023-05-29 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 19:59 Splitting dirty fs folios Matthew Wilcox
2023-05-29 22:39 ` Dave Chinner
2023-05-29 22:44   ` Matthew Wilcox [this message]

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=ZHUq4UrM7+wM0lYu@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.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).