All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] xfs: extended attribute scrub fixes
@ 2019-06-25  3:02 Darrick J. Wong
  2019-06-25  3:02 ` [PATCH 1/5] xfs: attribute scrub should use seen_enough to pass error values Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Darrick J. Wong @ 2019-06-25  3:02 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs

Hi all,

I discovered by sampling xfs_scrub stack trace swith a flame graph that
the attr scrub code has a sizeable oversight -- the xattr scrub code
always allocates a zeroed 65K temporary buffer before locking the inode,
even if it then turns out that the inode does not have extended
attributes.

In addition to the pointless memory allocation, the scrub code itself is
careful to initialize whatever part of the memory buffer it's going to
use before reading the contents, which means that the memory clearing is
not only painful (it's 5% of the sample traces!) but totally pointless.

Therefore, this series first cleans up the open-coded pointer
calculations where the buffer is concerned, and then restructures the
code so to allocate the smallest size buffer needed and only just before
it's actually needed.  The final patch disables buffer zeroing for
better performance.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=attr-scrub-fixes

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-25  3:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  3:02 [PATCH 0/5] xfs: extended attribute scrub fixes Darrick J. Wong
2019-06-25  3:02 ` [PATCH 1/5] xfs: attribute scrub should use seen_enough to pass error values Darrick J. Wong
2019-06-25  3:02 ` [PATCH 2/5] xfs: refactor extended attribute buffer pointer functions Darrick J. Wong
2019-06-25  3:02 ` [PATCH 3/5] xfs: refactor attr scrub memory allocation function Darrick J. Wong
2019-06-25  3:02 ` [PATCH 4/5] xfs: only allocate memory for scrubbing attributes when we need it Darrick J. Wong
2019-06-25  3:03 ` [PATCH 5/5] xfs: online scrub needn't bother zeroing its temporary buffer Darrick J. Wong

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.