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
F168193343: D9762.id25614.diff
Wed, Aug 26, 7:45 PM
Unknown Object (File)
Tue, Aug 18, 3:05 PM
Unknown Object (File)
Mon, Aug 17, 5:33 PM
Unknown Object (File)
Sun, Aug 16, 8:08 PM
Unknown Object (File)
Sun, Aug 16, 4:13 PM
Unknown Object (File)
Sun, Aug 16, 6:18 AM
Unknown Object (File)
Sat, Aug 15, 7:46 PM
Unknown Object (File)
Fri, Aug 14, 7:27 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
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 7694
Build 7841: arc lint + arc unit

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.