All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Raghav <pankaj.raghav@linux.dev>
To: Christoph Hellwig <hch@lst.de>
Cc: Andres Freund <andres@anarazel.de>,
	linux-xfs@vger.kernel.org, Carlos Maiolino <cem@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	gost.dev@samsung.com, p.raghav@samsung.com
Subject: Re: Increase in XFS journal flushes with (direct_write;fdatasync)+
Date: Fri, 8 May 2026 10:29:38 +0200	[thread overview]
Message-ID: <610346dc-ba8d-471f-be38-2429c5646416@linux.dev> (raw)
In-Reply-To: <20260508081047.GA19748@lst.de>

On 5/8/26 10:10, Christoph Hellwig wrote:
> On Thu, May 07, 2026 at 10:34:43PM +0200, Pankaj Raghav (Samsung) wrote:
>> This fix seems to reduce the number flush calls and fix the regression.
>> @carlos and @hch let me know if this is the correct fix or I am just
>> suppressing the symptom and not fixing the root cause.
> 
> This looks good from a very quick look.  It'll need testing, a line
> length fix and preferably a comment as a reminder and should be good
> to go.
> 

What about this:

diff --git a/fs/inode.c b/fs/inode.c
index 6a3cbc7dcd28..1b373fe1100d 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2124,7 +2124,12 @@ static int inode_update_cmtime(struct inode *inode, unsigned int flags)
                            inode_iversion_need_inc(inode))
                                return -EAGAIN;
                } else {
-                       if (inode_maybe_inc_iversion(inode, !!dirty))
+                       /*
+                        * Don't force iversion increment for pure lazytime
+                        * updates (when dirty is set to I_DIRTY_TIME only).
+                        */
+                       if (inode_maybe_inc_iversion(inode,
+                                                    dirty != I_DIRTY_TIME))
                                dirty |= I_DIRTY_SYNC;
                }
        }

If you are tests are passing, then I can send a fix as a separate patch.

--
Pankaj



  reply	other threads:[~2026-05-08  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <IS8F8EYS5pW4UU5a3jxOTy-f18EgkDa_2zAUswRgTm6NVtvmajAaQyu9CDxkTelDnfXfCl7L_692C77zRAxwFQ==@protonmail.internalid>
2026-05-06 13:26 ` Increase in XFS journal flushes with (direct_write;fdatasync)+ Andres Freund
2026-05-06 15:05   ` Carlos Maiolino
2026-05-07 20:34   ` Pankaj Raghav (Samsung)
2026-05-08  8:10     ` Christoph Hellwig
2026-05-08  8:29       ` Pankaj Raghav [this message]
2026-05-08  8:43         ` Christoph Hellwig
2026-05-08 11:42           ` Jeff Layton
2026-05-08 11:47             ` Pankaj Raghav
2026-05-11  8:56               ` Christoph Hellwig
2026-05-11 10:31                 ` Pankaj Raghav
2026-05-12  5:25     ` Dave Chinner

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=610346dc-ba8d-471f-be38-2429c5646416@linux.dev \
    --to=pankaj.raghav@linux.dev \
    --cc=andres@anarazel.de \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=p.raghav@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.