Skip to content

DAOS-19427 dfuse: defer cache invalidations off the worker pool - #18802

Open
mchaarawi wants to merge 1 commit into
masterfrom
mschaara/dfuse_inval
Open

DAOS-19427 dfuse: defer cache invalidations off the worker pool#18802
mchaarawi wants to merge 1 commit into
masterfrom
mschaara/dfuse_inval

Conversation

@mchaarawi

@mchaarawi mchaarawi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

dfuse worker threads are the sole readers of /dev/fuse and run a fixed-size pool. Request handlers called fuse_lowlevel_notify_inval_entry() and friends inline; those block on kernel inode locks (parent i_rwsem) that a client may hold while waiting on the same worker pool, deadlocking the mount (e.g. test_alloc_fail_cont_create with concurrent UNS creates).

Add an on-demand invalidation queue drained by the existing invalidation thread and route the setxattr, lookup, open, opendir, and rename notify calls through it. open/opendir transfer their held inode reference into the queue item so it is dropped after the notify. No /dev/fuse reader issues a blocking notify, breaking the cycle while preserving the invalidations.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Ticket title is 'NLT stage timing out (~63 min) on master and PR builds — daos container create fault injection appears to hang'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-19427

@mchaarawi
mchaarawi force-pushed the mschaara/dfuse_inval branch from 15a1464 to 74216bd Compare August 6, 2026 16:34
dfuse worker threads are the sole readers of /dev/fuse and run a
fixed-size pool.  Request handlers called fuse_lowlevel_notify_inval_entry()
inline; that blocks acquiring the parent's kernel i_rwsem, which a client
may hold while waiting on the same worker pool, deadlocking the mount
(e.g. test_alloc_fail_cont_create with concurrent UNS creates).

Add an on-demand dentry invalidation queue drained by the existing
invalidation thread and route the setxattr, lookup, rename, open and
opendir notify_inval_entry calls through it.  open/opendir transfer their
held inode reference into the queue item so it is dropped after the notify.
No /dev/fuse reader issues a blocking notify_inval_entry, breaking the
cycle while preserving the invalidations.

inval_inode/notify_delete (ioctl, unlink) are left synchronous: under
writeback caching they block on dirty-page writeback that only a worker
can service, so deferring them to the invalidation thread would hang the
shutdown join once the workers have exited.  The invalidation thread also
stops issuing notifies once shutdown has begun so the join stays bounded.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
@mchaarawi
mchaarawi force-pushed the mschaara/dfuse_inval branch from 74216bd to 88b2340 Compare August 6, 2026 20:34
@mchaarawi mchaarawi changed the title DAOS-XXXXX dfuse: defer cache invalidations off the worker pool DAOS-19427 dfuse: defer cache invalidations off the worker pool Aug 7, 2026
@mchaarawi
mchaarawi marked this pull request as ready for review August 7, 2026 13:06
@mchaarawi
mchaarawi requested review from a team as code owners August 7, 2026 13:06
@mjmac

mjmac commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@mchaarawi I started goofing around with making a fix, was going to tag you after it had passed (ran into unrelated NLT log size issues, attempting to fix by moving the new tests into their own "stress" section): #18806

Mine is either overengineered or potentially more complete, depending on how you look at it... :) Feel free to mine it for ideas. The new NLT stress tests might be useful for validating your approach.

@mchaarawi

Copy link
Copy Markdown
Contributor Author

@mchaarawi I started goofing around with making a fix, was going to tag you after it had passed (ran into unrelated NLT log size issues, attempting to fix by moving the new tests into their own "stress" section): #18806

Mine is either overengineered or potentially more complete, depending on how you look at it... :) Feel free to mine it for ideas. The new NLT stress tests might be useful for validating your approach.

it is neither.. you are just simply doing too many things in one PR IMO.
im more than happy to close this PR and go with yours if:

  1. you remove all the test changes and keep NLT as it is.
  2. remove the duns change.. this should not be a duns responsibility to do polling and will effect many other apps that use duns directly.

@mchaarawi

Copy link
Copy Markdown
Contributor Author

@mchaarawi I started goofing around with making a fix, was going to tag you after it had passed (ran into unrelated NLT log size issues, attempting to fix by moving the new tests into their own "stress" section): #18806
Mine is either overengineered or potentially more complete, depending on how you look at it... :) Feel free to mine it for ideas. The new NLT stress tests might be useful for validating your approach.

it is neither.. you are just simply doing too many things in one PR IMO. im more than happy to close this PR and go with yours if:

  1. you remove all the test changes and keep NLT as it is.
  2. remove the duns change.. this should not be a duns responsibility to do polling and will effect many other apps that use duns directly.

actually i take that back.. it does look like you have more changes than i was reviewing.
maybe it is over-engineered :-)

@mchaarawi

mchaarawi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@mchaarawi I started goofing around with making a fix, was going to tag you after it had passed (ran into unrelated NLT log size issues, attempting to fix by moving the new tests into their own "stress" section): #18806

Mine is either overengineered or potentially more complete, depending on how you look at it... :) Feel free to mine it for ideas. The new NLT stress tests might be useful for validating your approach.

ok i should have reviewed your PR more closely, i appologize.. i posted some comments there.

ultimately, i think my PR is simpler bec i just tried to resolve your finding that you posted in the ticket with fuse_lowlevel_notify_inval_entry(). but your PR goes beyond that. im not sure yet if it is all required or not yet.

does it make sense to land this one first (if there are no functional issues)
as it is simpler and looks to resolve the issue, but rebase yours and study it more?
i do want to avoid NLT test changes for now as im working on refactoring NLT itself in a different PR.

@mjmac

mjmac commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

does it make sense to land this one first (if there are no functional issues) as it is simpler and looks to resolve the issue, but rebase yours and study it more? i do want to avoid NLT test changes for now as im working on refactoring NLT itself in a different PR.

I'm fine with that. I'm running a local test with your fix and the new NLT stress tests to see how it does. Will post results when it's finished.

Does your NLT work include something like #18779 ? If not, I'd like to get that into master because it was really helpful in finding this issue.

@mchaarawi

Copy link
Copy Markdown
Contributor Author

does it make sense to land this one first (if there are no functional issues) as it is simpler and looks to resolve the issue, but rebase yours and study it more? i do want to avoid NLT test changes for now as im working on refactoring NLT itself in a different PR.

I'm fine with that. I'm running a local test with your fix and the new NLT stress tests to see how it does. Will post results when it's finished.

Does your NLT work include something like #18779 ? If not, I'd like to get that into master because it was really helpful in finding this issue.

it is here #18808
and no nothing like this..

@mjmac

mjmac commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@mchaarawi: My local testing of your patch with the NLT reproducer seems to show that your patch fixes it. The repro fails pretty consistently on unpatched master.

@mjmac mjmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and passes the stress tests I added in my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants