Page MenuHomeFreeBSD

Add taskqueue_quiesce().
ClosedPublic

Authored by markj on Nov 13 2018, 5:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 18 2024, 10:44 AM
Unknown Object (File)
Dec 22 2023, 9:53 PM
Unknown Object (File)
Dec 14 2023, 7:12 PM
Unknown Object (File)
Sep 10 2023, 8:17 AM
Unknown Object (File)
Sep 3 2023, 9:23 PM
Unknown Object (File)
Aug 16 2023, 4:54 AM
Unknown Object (File)
Aug 16 2023, 4:47 AM
Unknown Object (File)
Aug 4 2023, 5:30 AM
Subscribers

Details

Summary

This emulates illumos' taskq_wait() in that it doesn't return until the
queue is completely empty. This fixes some races when shutting down
ZFS as described in PR 227784.

Test Plan

wulf@ reports that this fixes the panic reported in PR 227784.

Diff Detail

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

Event Timeline

markj added reviewers: mav, avg, jhb, allanjude.
cem added a subscriber: cem.

The code and documentation look good; I'm just not sure if we want a new API for this, or if changing taskqueue_drain_all()'s behavior to match this would be unobjectionable.

This revision is now accepted and ready to land.Nov 15 2018, 5:34 PM

Any thoughts on this approach? To provide a bit more detail, the issue is that some ZFS tasks may recursively enqueue tasks, but a taskqueue_drain_all() doesn't wait for them. It might be that we could just change the behaviour of taskqueue_drain_all() instead.

Any thoughts on this approach? To provide a bit more detail, the issue is that some ZFS tasks may recursively enqueue tasks, but a taskqueue_drain_all() doesn't wait for them. It might be that we could just change the behaviour of taskqueue_drain_all() instead.

Looks like the LinuxKPI's flush_workqueue() maps to the existing taskqueue_drain_all(), so we probably don't want to change the existing behaviour.

I plan to commit this in the next day or so if there are no objections.

This revision was automatically updated to reflect the committed changes.