diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-07-09 22:33:30 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 04:07:37 -0400 |
commit | a4683487f90bfe3049686fc5c566bdc1ad03ace6 (patch) | |
tree | b5aeadd3155256378804c04571febeee9f77c5fb /drivers/scsi | |
parent | 2955b47d2c1983998a8c5915cb96884e67f7cb53 (diff) |
[SCSI] async: make async_synchronize_full() flush all work regardless of domain
In response to an async related regression James noted:
"My theory is that this is an init problem: The assumption in a lot of
our code is that async_synchronize_full() waits for everything ... even
the domain specific async schedules, which isn't true."
...so make this assumption true.
Each domain, including the default one, registers itself on a global domain
list when work is scheduled. Once all entries complete it exits that
list. Waiting for the list to be empty syncs all in-flight work across
all domains.
Domains can opt-out of global syncing if they are declared as exclusive
ASYNC_DOMAIN_EXCLUSIVE(). All stack-based domains have been declared
exclusive since the domain may go out of scope as soon as the last work
item completes.
Statically declared domains are mostly ok, but async_unregister_domain()
is there to close any theoretical races with pending
async_synchronize_full waiters at module removal time.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Reported-by: Meelis Roos <mroos@linux.ee>
Reported-by: Eldad Zack <eldadzack@gmail.com>
Tested-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 4cade886a50a..2936b447cae9 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -1355,6 +1355,7 @@ static void __exit exit_scsi(void) | |||
1355 | scsi_exit_devinfo(); | 1355 | scsi_exit_devinfo(); |
1356 | scsi_exit_procfs(); | 1356 | scsi_exit_procfs(); |
1357 | scsi_exit_queue(); | 1357 | scsi_exit_queue(); |
1358 | async_unregister_domain(&scsi_sd_probe_domain); | ||
1358 | } | 1359 | } |
1359 | 1360 | ||
1360 | subsys_initcall(init_scsi); | 1361 | subsys_initcall(init_scsi); |