From: Allison Henderson <allison.henderson@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v16 00/11] xfs: Delay Ready Attributes
Date: Fri, 2 Apr 2021 02:49:25 -0700 [thread overview]
Message-ID: <4fe20d74-7631-3c25-8eb2-bb7d760c0282@oracle.com> (raw)
In-Reply-To: <20210329215952.GJ4090233@magnolia>
On 3/29/21 2:59 PM, Darrick J. Wong wrote:
> On Thu, Mar 25, 2021 at 05:32:57PM -0700, Allison Henderson wrote:
>> Hi all,
>>
>> This set is a subset of a larger series for Dealyed Attributes. Which is a
>> subset of a yet larger series for parent pointers. Delayed attributes allow
>> attribute operations (set and remove) to be logged and committed in the same
>> way that other delayed operations do. This allows more complex operations (like
>> parent pointers) to be broken up into multiple smaller transactions. To do
>> this, the existing attr operations must be modified to operate as a delayed
>> operation. This means that they cannot roll, commit, or finish transactions.
>> Instead, they return -EAGAIN to allow the calling function to handle the
>> transaction. In this series, we focus on only the delayed attribute portion.
>> We will introduce parent pointers in a later set.
>>
>> In this version I have reduced the set back to the "Delay Ready Attrs" sub series to
>> avoid reviewer burn out, but the extended series is available to view in the inlcuded
>> git hub links, which extend all the way through parent pointers. Feel free to review
>> as much as feels reasonable. The set as a whole is a bit much to digest at once, so
>> working through it in progressive subsets seems like a reasonable way to manage its
>> dev efforts.
>>
>> Lastly, in the last revision folks asked for some stress testing on the set. On my
>> system, I found that in an fsstress test with all patches applied, we spend at most
>> %0.17 of the time in the attr routines, compared to at most %0.12 with out the set applied.
>> Both can fluctuate quite a bit depending on the other operations going on that seem to
>> occupy most of the activity. For the most part though, I do not find these results to be
>> particularly concerning. Though folks are certainly welcome to try it out on their own
>> system to see how the results might differ.
>>
>> Updates since v15: Mostly just review feed back from the previous revision. I've
>> tracked changes below to help reviews recall the changes discussed
>
> Hmm... so I ran fstests against this on an otherwise default V5
> filesystem, and saw three new regressions:
>
> xfs/125 spat out this from the final repair run:
>
> Phase 1 - find and verify superblock...
> Phase 2 - using internal log
> - zero log...
> - scan filesystem freespace and inode maps...
> - found root inode chunk
> Phase 3 - for each AG...
> - scan (but don't clear) agi unlinked lists...
> - process known inodes and perform inode discovery...
> - agno = 0
> attribute entry #32 in attr block 2, inode 134 is INCOMPLETE
> problem with attribute contents in inode 134
> would clear attr fork
> bad nblocks 8 for inode 134, would reset to 0
> bad anextents 4 for inode 134, would reset to 0
> - agno = 1
> - agno = 2
> - agno = 3
> - process newly discovered inodes...
> Phase 4 - check for duplicate blocks...
> - setting up duplicate extent list...
> - check for inodes claiming duplicate blocks...
> - agno = 0
> - agno = 1
> - agno = 2
> - agno = 3
> No modify flag set, skipping phase 5
> Phase 6 - check inode connectivity...
> - traversing filesystem ...
> - traversal finished ...
> - moving disconnected inodes to lost+found ...
> Phase 7 - verify link counts...
> No modify flag set, skipping filesystem flush and exiting.
> xfs_repair should not fail
>
> And xfs/434 and xfs/436 both complained about memory leaks stemming from
> an xfs_da_state that xfs/125 didn't free correctly:
>
> [ 1247.150683] =============================================================================
> [ 1247.151799] BUG xfs_da_state (Tainted: G B W ): Objects remaining in xfs_da_state on __kmem_cache_shutdown()
> [ 1247.153246] -----------------------------------------------------------------------------
> [ 1247.153246]
> [ 1247.154528] INFO: Slab 0xffffea00002e9280 objects=17 used=11 fp=0xffff88800ba4b4a0 flags=0xfff80000010200
> [ 1247.155764] CPU: 2 PID: 50257 Comm: modprobe Tainted: G B W 5.12.0-rc4-djwx #rc4
> [ 1247.156849] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
> [ 1247.157996] Call Trace:
> [ 1247.158330] dump_stack+0x64/0x7c
> [ 1247.158767] slab_err+0xb7/0xdc
> [ 1247.159196] ? printk+0x58/0x6f
> [ 1247.159615] __kmem_cache_shutdown.cold+0x39/0x15e
> [ 1247.160248] kmem_cache_destroy+0x3f/0x110
> [ 1247.160779] xfs_destroy_zones+0xbe/0xe2 [xfs]
> [ 1247.161462] exit_xfs_fs+0x5f/0x9b4 [xfs]
> [ 1247.162065] __do_sys_delete_module.constprop.0+0x145/0x220
> [ 1247.162740] do_syscall_64+0x2d/0x40
> [ 1247.163197] entry_SYSCALL_64_after_hwframe+0x44/0xae
> [ 1247.163810] RIP: 0033:0x7fd91cfe4bcb
> [ 1247.164262] Code: 73 01 c3 48 8b 0d c5 82 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 95 82 0c 00 f7 d8 64 89 01 48
> [ 1247.166352] RSP: 002b:00007fff89097038 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
> [ 1247.167217] RAX: ffffffffffffffda RBX: 0000558b8e105cc0 RCX: 00007fd91cfe4bcb
> [ 1247.167998] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 0000558b8e105d28
> [ 1247.168781] RBP: 0000558b8e105cc0 R08: 0000000000000000 R09: 0000000000000000
> [ 1247.169562] R10: 00007fd91d060ac0 R11: 0000000000000206 R12: 0000558b8e105d28
> [ 1247.170351] R13: 0000000000000000 R14: 0000558b8e105d28 R15: 0000558b8e105cc0
>
> From a quick bisect, all of thse problem originates in the last patch.
Alrighty, I will see if I can recreate these bugs and get that figured
out. Thanks!
Allison
>
> --D
>
>> xfs: Reverse apply 72b97ea40d
>> NEW
>>
>> xfs: Add helper xfs_attr_node_remove_step
>> DROPPED
>>
>> xfs: Add xfs_attr_node_remove_cleanup
>> No change
>>
>> xfs: Hoist transaction handling in xfs_attr_node_remove_step
>> DROPPED
>>
>> xfs: Hoist xfs_attr_set_shortform
>> No change
>>
>> xfs: Add helper xfs_attr_set_fmt
>> Fixed helper to return error when defer_finish fails
>>
>> xfs: Separate xfs_attr_node_addname and xfs_attr_node_addname_work
>> Renamed xfs_attr_node_addname_work to xfs_attr_node_addname_clear_incomplete
>>
>> xfs: Add helper xfs_attr_node_addname_find_attr
>> Renamed goto out, to goto error
>>
>> xfs: Hoist xfs_attr_node_addname
>> Removed unused retval variable
>> Removed extra state free in xfs_attr_node_addname
>>
>> xfs: Hoist xfs_attr_leaf_addname
>> Fixed spelling typos
>>
>> xfs: Hoist node transaction handling
>> Added consistent braces to if/else statement
>>
>> xfs: Add delay ready attr remove routines
>> Typo fixes
>> Merged xfs_attr_remove_iter with xfs_attr_node_removename_iter
>> Added state XFS_DAS_RMTBLK
>> Flow chart updated
>>
>> xfs: Add delay ready attr set routines
>> Rebase adjustments
>> Typo fixes
>>
>>
>> Extended Series Changes
>> ------------------------
>> xfs: Add state machine tracepoints
>> Rebase adjustments
>> xfs_attr_node_remove_rmt_return removed to match earlier refactoring changes
>> trace_xfs_attr_node_removename_iter_return becomes
>> trace_xfs_attr_remove_iter_return to match earlier refactoring changes
>>
>> xfs: Rename __xfs_attr_rmtval_remove
>> No change
>>
>> xfs: Handle krealloc errors in xlog_recover_add_to_cont_trans
>> Added kmem_alloc_large fall back
>>
>> xfs: Set up infrastructure for deferred attribute operations
>> Typo fixes
>> Rename xfs_trans_attr to xfs_trans_attr_finish_update
>> Added helper function xfs_attri_validate
>> Split patch into infrastructure and implementation patches
>> Added XFS_ERROR_REPORT in xlog_recover_attri_commit_pass2:
>>
>> xfs: Implement for deferred attribute operations
>> NEW
>>
>> xfs: Skip flip flags for delayed attrs
>> Did a performance analysis
>>
>> xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred
>> Typo fixes
>>
>> xfs: Remove unused xfs_attr_*_args
>> Rebase adjustments
>>
>> xfs: Add delayed attributes error tag
>> Added errortag include
>>
>> xfs: Merge xfs_delattr_context into xfs_attr_item
>> Typo fixes
>>
>>
>> This series can be viewed on github here:
>> https://urldefense.com/v3/__https://github.com/allisonhenderson/xfs_work/tree/delay_ready_attrs_v16__;!!GqivPVa7Brio!Ol0JaXyUI3K5MEGrBo_eMHzcTqcuIL9p25-XSZftWgn4bmbxeX_AJf7Hl-kP6ecxUskY$
>>
>> As well as the extended delayed attribute and parent pointer series:
>> https://urldefense.com/v3/__https://github.com/allisonhenderson/xfs_work/tree/delay_ready_attrs_v16_extended__;!!GqivPVa7Brio!Ol0JaXyUI3K5MEGrBo_eMHzcTqcuIL9p25-XSZftWgn4bmbxeX_AJf7Hl-kP6QsZXJc5$
>>
>> And the test cases:
>> https://urldefense.com/v3/__https://github.com/allisonhenderson/xfs_work/tree/pptr_xfstestsv2__;!!GqivPVa7Brio!Ol0JaXyUI3K5MEGrBo_eMHzcTqcuIL9p25-XSZftWgn4bmbxeX_AJf7Hl-kP6fAPHdk4$
>>
>> In order to run the test cases, you will need have the corresponding xfsprogs
>> changes as well. Which can be found here:
>> https://urldefense.com/v3/__https://github.com/allisonhenderson/xfs_work/tree/delay_ready_attrs_xfsprogs_v16__;!!GqivPVa7Brio!Ol0JaXyUI3K5MEGrBo_eMHzcTqcuIL9p25-XSZftWgn4bmbxeX_AJf7Hl-kP6ToIBbr7$
>> https://urldefense.com/v3/__https://github.com/allisonhenderson/xfs_work/tree/delay_ready_attrs_xfsprogs_v16_extended__;!!GqivPVa7Brio!Ol0JaXyUI3K5MEGrBo_eMHzcTqcuIL9p25-XSZftWgn4bmbxeX_AJf7Hl-kP6cfTeHmh$
>>
>> To run the xfs attributes tests run:
>> check -g attr
>>
>> To run as delayed attributes run:
>> export MOUNT_OPTIONS="-o delattr"
>> check -g attr
>>
>> To run parent pointer tests:
>> check -g parent
>>
>> I've also made the corresponding updates to the user space side as well, and ported anything
>> they need to seat correctly.
>>
>> Questions, comment and feedback appreciated!
>>
>> Thanks all!
>> Allison
>>
>> Allison Henderson (11):
>> xfs: Reverse apply 72b97ea40d
>> xfs: Add xfs_attr_node_remove_cleanup
>> xfs: Hoist xfs_attr_set_shortform
>> xfs: Add helper xfs_attr_set_fmt
>> xfs: Separate xfs_attr_node_addname and
>> xfs_attr_node_addname_clear_incomplete
>> xfs: Add helper xfs_attr_node_addname_find_attr
>> xfs: Hoist xfs_attr_node_addname
>> xfs: Hoist xfs_attr_leaf_addname
>> xfs: Hoist node transaction handling
>> xfs: Add delay ready attr remove routines
>> xfs: Add delay ready attr set routines
>>
>> fs/xfs/libxfs/xfs_attr.c | 903 ++++++++++++++++++++++++----------------
>> fs/xfs/libxfs/xfs_attr.h | 364 ++++++++++++++++
>> fs/xfs/libxfs/xfs_attr_leaf.c | 2 +-
>> fs/xfs/libxfs/xfs_attr_remote.c | 126 ++++--
>> fs/xfs/libxfs/xfs_attr_remote.h | 7 +-
>> fs/xfs/xfs_attr_inactive.c | 2 +-
>> fs/xfs/xfs_trace.h | 1 -
>> 7 files changed, 998 insertions(+), 407 deletions(-)
>>
>> --
>> 2.7.4
>>
prev parent reply other threads:[~2021-04-02 9:49 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-26 0:32 [PATCH v16 00/11] xfs: Delay Ready Attributes Allison Henderson
2021-03-26 0:32 ` [PATCH v16 01/11] xfs: Reverse apply 72b97ea40d Allison Henderson
2021-03-29 8:44 ` Chandan Babu R
2021-04-02 9:47 ` Allison Henderson
2021-04-01 15:43 ` Brian Foster
2021-04-02 9:49 ` Allison Henderson
2021-03-26 0:32 ` [PATCH v16 02/11] xfs: Add xfs_attr_node_remove_cleanup Allison Henderson
2021-03-26 0:33 ` [PATCH v16 03/11] xfs: Hoist xfs_attr_set_shortform Allison Henderson
2021-03-29 9:21 ` Chandan Babu R
2021-04-02 9:47 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 04/11] xfs: Add helper xfs_attr_set_fmt Allison Henderson
2021-03-29 9:37 ` Chandan Babu R
2021-04-02 9:47 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 05/11] xfs: Separate xfs_attr_node_addname and xfs_attr_node_addname_clear_incomplete Allison Henderson
2021-03-29 14:42 ` Chandan Babu R
2021-04-02 9:00 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 06/11] xfs: Add helper xfs_attr_node_addname_find_attr Allison Henderson
2021-04-02 4:05 ` Chandan Babu R
2021-04-02 9:50 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 07/11] xfs: Hoist xfs_attr_node_addname Allison Henderson
2021-04-02 4:26 ` Chandan Babu R
2021-04-02 9:01 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 08/11] xfs: Hoist xfs_attr_leaf_addname Allison Henderson
2021-04-01 15:43 ` Brian Foster
2021-04-02 9:01 ` Allison Henderson
2021-04-05 13:15 ` Brian Foster
2021-04-02 4:40 ` Chandan Babu R
2021-04-02 9:50 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 09/11] xfs: Hoist node transaction handling Allison Henderson
2021-04-02 5:04 ` Chandan Babu R
2021-04-02 9:51 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 10/11] xfs: Add delay ready attr remove routines Allison Henderson
2021-04-01 16:55 ` Brian Foster
2021-04-02 9:42 ` Allison Henderson
2021-04-05 13:15 ` Brian Foster
2021-04-02 7:59 ` Chandan Babu R
2021-04-02 9:45 ` Allison Henderson
2021-03-26 0:33 ` [PATCH v16 11/11] xfs: Add delay ready attr set routines Allison Henderson
2021-04-01 16:57 ` Brian Foster
2021-04-02 9:01 ` Allison Henderson
2021-04-05 13:17 ` Brian Foster
2021-04-14 18:14 ` Allison Henderson
2021-03-29 21:59 ` [PATCH v16 00/11] xfs: Delay Ready Attributes Darrick J. Wong
2021-04-02 9:49 ` Allison Henderson [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=4fe20d74-7631-3c25-8eb2-bb7d760c0282@oracle.com \
--to=allison.henderson@oracle.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;
as well as URLs for NNTP newsgroup(s).