-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible deadlock in ARC between arc_shrinker and arc_user_evicts_thread #4688
Comments
How does a4eeee6 look for a fix? Pinging @prakashsurya since I think this was part of the arc multilist rework. |
@dweeezil it's getting late here but if I'm not completely asleep I think you've introduced a subtle change in semantics since you've also moved the:
in the else branch in case ->b_efunc is not set, meaning that you access b_data without the b_evict_lock being held. Now I haven't looked the code in details to see if this member is protected by the evict lock. This is something which should be checked. Also the check for b_efunc presence is done outside of the buffer's evict lock which itself might lead to subtle bugs. |
I was planning on looking into both of those issues but a quick look around earlier seemed to indicate that the exact |
@dweeezil so took another look in arc_do_user_evicts and b_efunc is being checked and written to outside of b_evict_lock. So based on that LGTM. |
is the potential deadlock due to how the locks are acquired in
and
? If so, my initial thought is this isn't an issue because I could easily be overlooking something though, but before I look at this in detail, I want to verify the two call paths (it looks like the stacks in the bug report are truncated, probably due to inline functions). |
This looks very similar to a deadlock I'm seeing every few days on a test server. |
While running some zfs tests I got the following splat:
If I have understood this correctly it seems that
arc_do_user_evicts
acquiresarc_user_evicts_lock
first and thenb_evict_lock
while settingb_hdr
to null. At the same time the arc shrinker, which is invoked by the kernel in low memory conditions, locksb_evict_lock
and thenarc_user_evicts_lock
. The actual call chain in arc_evict_state before inlining is :arc_evict_state->arc_evict_state_impl->arc_evict_hdr
The text was updated successfully, but these errors were encountered: