summaryrefslogtreecommitdiff
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2015-09-02 20:49:46 (GMT)
committerNeilBrown <neilb@suse.com>2015-11-01 02:48:26 (GMT)
commita8c34f915976e3de044cc31b8bcb46f816f5a52e (patch)
tree77423093942eedb3d69652dd6996ab3e29476b54 /drivers/md/raid5.c
parent5c7e81c3de9eb3db01e16190a1da0899efee645b (diff)
downloadlinux-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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index b0bf81d..46042c7 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;