diff options
author | Shaohua Li <shli@fb.com> | 2015-09-02 23:49:46 +0300 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-11-01 05:48:26 +0300 |
commit | a8c34f915976e3de044cc31b8bcb46f816f5a52e (patch) | |
tree | 77423093942eedb3d69652dd6996ab3e29476b54 /drivers/md/raid5.c | |
parent | 5c7e81c3de9eb3db01e16190a1da0899efee645b (diff) | |
download | linux-a8c34f915976e3de044cc31b8bcb46f816f5a52e.tar.xz |
raid5-cache: switching to state machine for log disk cache flush
Before we write stripe data to raid disks, we must guarantee stripe data
is settled down in log disk. To do this, we flush log disk cache and
wait the flush finish. That wait introduces sleep time in raid5d thread
and impact performance. This patch moves the log disk cache flush
process to the stripe handling state machine, which can remove the wait
in raid5d.
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index b0bf81d084fd..46042c7c25a5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5740,8 +5740,12 @@ static int handle_active_stripes(struct r5conf *conf, int group, for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++) if (!list_empty(temp_inactive_list + i)) break; - if (i == NR_STRIPE_HASH_LOCKS) + if (i == NR_STRIPE_HASH_LOCKS) { + spin_unlock_irq(&conf->device_lock); + r5l_flush_stripe_to_raid(conf->log); + spin_lock_irq(&conf->device_lock); return batch_size; + } release_inactive = true; } spin_unlock_irq(&conf->device_lock); @@ -5749,6 +5753,7 @@ static int handle_active_stripes(struct r5conf *conf, int group, release_inactive_stripe_list(conf, temp_inactive_list, NR_STRIPE_HASH_LOCKS); + r5l_flush_stripe_to_raid(conf->log); if (release_inactive) { spin_lock_irq(&conf->device_lock); return 0; |