Page MenuHomeFreeBSD

zfs: call spa_deadman on a taskqueue thread
ClosedPublic

Authored by avg on Feb 23 2017, 11:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 8 2024, 3:59 PM
Unknown Object (File)
May 8 2024, 2:55 PM
Unknown Object (File)
Apr 6 2024, 8:07 AM
Unknown Object (File)
Feb 21 2024, 6:09 AM
Unknown Object (File)
Feb 16 2024, 6:40 AM
Unknown Object (File)
Feb 16 2024, 5:38 AM
Unknown Object (File)
Jan 16 2024, 8:38 PM
Unknown Object (File)
Jan 14 2024, 10:07 PM
Subscribers

Details

Summary

callout(9) prohibits callout functions from sleeping.
illumos mutexes are emulated using sx(9).
spa_deadman() calls vdev_deadman() and the latter acquires vq_lock.

As a result we can get a more confusing panic instead of a specific
panic or no panic:
sleepq_add: td 0xfffff80019669960 to sleep on wchan 0xfffff8001cff4d88 with sleeping prohibited

This change adds another level of indirection where the deadman
callout schedules spa_deadman() to be executed on taskqueue_thread.

While there, use callout_schedule(0 instead of callout_reset()
in spa_sync().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg retitled this revision from to zfs: call spa_deadman on a taskqueue thread.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: mav, smh, allanjude.
avg added a subscriber: ZFS.

Part about taskqueue looks reasonable. Just shouldn't there be taskqueue_drain() calls near callout_drain()?

Part about SBT_MAX looks iffy to me. Not sure the cure is better then decease.

In D9762#201594, @mav wrote:

Part about taskqueue looks reasonable. Just shouldn't there be taskqueue_drain() calls near callout_drain()?

Oops, I'll fix that.

Part about SBT_MAX looks iffy to me. Not sure the cure is better then decease.

There is a cleaner solution which is to add callout_init variant(s) that would accept func and arg, but I wanted to leave it for another day.

Thanks!

avg edited edge metadata.

drain the deadman task too

I hope that my impatience will be forgiven if I commit this now.

This revision was automatically updated to reflect the committed changes.