staging: lustre: obdclass: use workqueue for zombie management.
obdclass currently maintains two lists of data structures (imports and exports), and a kthread which will free anything on either list. The thread is woken whenever anything is added to either list. This is exactly the sort of thing that workqueues exist for. So discard the zombie kthread and the lists and locks, and create a single workqueue. Each obd_import and obd_export gets a work_struct to attach to this workqueue. This requires a small change to import_sec_validate_get() which was testing if an obd_import was on the zombie list. This cannot have every safely found it to be on the list (as it could be freed asynchronously) so it must be dead code. We could use system_wq instead of creating a dedicated zombie_wq, but as we occasionally want to flush all pending work, it is a little nicer to only have to wait for our own work items. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment