Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Switch workers to system_unbound_wq. #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/flashcache_conf.c
Expand Up @@ -1652,7 +1652,7 @@ flashcache_sync_for_remove(struct cache_c *dmc)
/* Wait for all the dirty blocks to get written out, and any other IOs */
wait_event(dmc->destroyq, !atomic_read(&dmc->nr_jobs));
cancel_delayed_work(&dmc->delayed_clean);
flush_scheduled_work();
flush_workqueue(system_unbound_wq);
} while (!dmc->sysctl_fast_remove && atomic_read(&dmc->nr_dirty) > 0);
}

Expand Down
12 changes: 6 additions & 6 deletions src/flashcache_main.c
Expand Up @@ -216,7 +216,7 @@ flashcache_io_callback(unsigned long error, void *context)
/* Kick off the write to the cache */
job->action = READFILL;
push_io(job);
schedule_work(&_kcached_wq);
queue_work(system_unbound_wq, &_kcached_wq);
return;
} else {
disk_error = -EIO;
Expand Down Expand Up @@ -336,7 +336,7 @@ flashcache_io_callback(unsigned long error, void *context)
if (unlikely(error || cacheblk->nr_queued > 0)) {
spin_unlock_irqrestore(&cache_set->set_spin_lock, flags);
push_pending(job);
schedule_work(&_kcached_wq);
queue_work(system_unbound_wq, &_kcached_wq);
} else {
cacheblk->cache_state &= ~BLOCK_IO_INPROG;
spin_unlock_irqrestore(&cache_set->set_spin_lock, flags);
Expand Down Expand Up @@ -686,7 +686,7 @@ flashcache_md_write_callback(unsigned long error, void *context)
else
job->error = 0;
push_md_complete(job);
schedule_work(&_kcached_wq);
queue_work(system_unbound_wq, &_kcached_wq);
}

static int
Expand Down Expand Up @@ -976,7 +976,7 @@ flashcache_md_write(struct kcached_job *job)
* deadlock.
*/
push_md_io(job);
schedule_work(&_kcached_wq);
queue_work(system_unbound_wq, &_kcached_wq);
}
}

Expand Down Expand Up @@ -1288,7 +1288,7 @@ flashcache_clean_set(struct cache_c *dmc, int set, int force_clean_blocks)
do_delayed_clean = 1;
spin_unlock_irq(&cache_set->set_spin_lock);
if (do_delayed_clean)
schedule_delayed_work(&dmc->delayed_clean, 1*HZ);
queue_delayed_work(system_unbound_wq, &dmc->delayed_clean, 1*HZ);
}
flashcache_diskclean_free(dmc, writes_list, set_dirty_list);
}
Expand Down Expand Up @@ -2364,7 +2364,7 @@ flashcache_uncached_io_callback(unsigned long error, void *context)
else
job->error = 0;
push_uncached_io_complete(job);
schedule_work(&_kcached_wq);
queue_work(system_unbound_wq, &_kcached_wq);
}

static void
Expand Down
2 changes: 1 addition & 1 deletion src/flashcache_procfs.c
Expand Up @@ -115,7 +115,7 @@ flashcache_sync_sysctl(ctl_table *table, int write,
if (dmc->sysctl_do_sync) {
dmc->sysctl_stop_sync = 0;
cancel_delayed_work(&dmc->delayed_clean);
flush_scheduled_work();
flush_workqueue(system_unbound_wq);
flashcache_sync_all(dmc);
}
}
Expand Down