From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: initialise di_crc in xfs_log_dinode
Date: Fri, 15 Dec 2023 09:31:32 +1100 [thread overview]
Message-ID: <ZXuCRNtth6VY6svP@dread.disaster.area> (raw)
In-Reply-To: <20231214214718.GL361584@frogsfrogsfrogs>
On Thu, Dec 14, 2023 at 01:47:18PM -0800, Darrick J. Wong wrote:
> On Fri, Dec 15, 2023 at 08:40:35AM +1100, Dave Chinner wrote:
> > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
> > index 157ae90d3d52..0287918c03dc 100644
> > --- a/fs/xfs/xfs_inode_item.c
> > +++ b/fs/xfs/xfs_inode_item.c
> > @@ -557,6 +557,9 @@ xfs_inode_to_log_dinode(
> > memset(to->di_pad2, 0, sizeof(to->di_pad2));
> > uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid);
> > to->di_v3_pad = 0;
> > +
> > + /* dummy value for initialisation */
> > + to->di_crc = 0;
>
> I wonder if the log should be using kzalloc instead of kmalloc for
> buffers that will end up on disk? Kind of a nasty performance hit
> just for the sake of paranoia, though.
That's really only an issue for the xfs_log_dinode - it's really the
only structure copy we do in log formating. For the rest of the
structures we are simply doing memcpy of large ranges of data into
the allocated space and there's really no point in zeroing memory
ranges that we are just about to entirely copy over.
Especially considering item formatting is the hottest part of the
transaction commit path....
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Thanks!
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2023-12-14 22:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 21:40 [PATCH] xfs: initialise di_crc in xfs_log_dinode Dave Chinner
2023-12-14 21:47 ` Darrick J. Wong
2023-12-14 22:31 ` Dave Chinner [this message]
2023-12-15 4:32 ` Christoph Hellwig
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=ZXuCRNtth6VY6svP@dread.disaster.area \
--to=david@fromorbit.com \
--cc=djwong@kernel.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