summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2015-09-02 16:49:46 -0400
committerNeilBrown <neilb@suse.com>2015-10-31 22:48:26 -0400
commita8c34f915976e3de044cc31b8bcb46f816f5a52e (patch)
tree77423093942eedb3d69652dd6996ab3e29476b54 /drivers/md/raid5.c
parent5c7e81c3de9eb3db01e16190a1da0899efee645b (diff)
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 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,
5740 for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++) 5740 for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++)
5741 if (!list_empty(temp_inactive_list + i)) 5741 if (!list_empty(temp_inactive_list + i))
5742 break; 5742 break;
5743 if (i == NR_STRIPE_HASH_LOCKS) 5743 if (i == NR_STRIPE_HASH_LOCKS) {
5744 spin_unlock_irq(&conf->device_lock);
5745 r5l_flush_stripe_to_raid(conf->log);
5746 spin_lock_irq(&conf->device_lock);
5744 return batch_size; 5747 return batch_size;
5748 }
5745 release_inactive = true; 5749 release_inactive = true;
5746 } 5750 }
5747 spin_unlock_irq(&conf->device_lock); 5751 spin_unlock_irq(&conf->device_lock);
@@ -5749,6 +5753,7 @@ static int handle_active_stripes(struct r5conf *conf, int group,
5749 release_inactive_stripe_list(conf, temp_inactive_list, 5753 release_inactive_stripe_list(conf, temp_inactive_list,
5750 NR_STRIPE_HASH_LOCKS); 5754 NR_STRIPE_HASH_LOCKS);
5751 5755
5756 r5l_flush_stripe_to_raid(conf->log);
5752 if (release_inactive) { 5757 if (release_inactive) {
5753 spin_lock_irq(&conf->device_lock); 5758 spin_lock_irq(&conf->device_lock);
5754 return 0; 5759 return 0;