summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-11-05 08:35:50 -0500
committerMike Snitzer <snitzer@redhat.com>2014-11-10 15:25:29 -0500
commit41abc4e1af369bb5438eaee398e3beee690cc8ca (patch)
treea94881ff00d7e3ab5d42544670c77a6bff8224ef /drivers/md
parent6fa9952097747f71c5077f3e14ce3f8adee6f778 (diff)
dm: do not call dm_sync_table() when creating new devices
When creating new devices dm_sync_table() calls synchronize_rcu_expedited(), causing _all_ pending RCU pointers to be flushed. This causes a latency overhead that is especially noticeable when creating lots of devices. And all of this is pointless as there are no old maps to be disconnected, and hence no stale pointers which would need to be cleared up. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 16a806a99b99..866ff19aa438 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2341,7 +2341,8 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
2341 set_bit(DMF_MERGE_IS_OPTIONAL, &md->flags); 2341 set_bit(DMF_MERGE_IS_OPTIONAL, &md->flags);
2342 else 2342 else
2343 clear_bit(DMF_MERGE_IS_OPTIONAL, &md->flags); 2343 clear_bit(DMF_MERGE_IS_OPTIONAL, &md->flags);
2344 dm_sync_table(md); 2344 if (old_map)
2345 dm_sync_table(md);
2345 2346
2346 return old_map; 2347 return old_map;
2347} 2348}
@@ -2782,7 +2783,8 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
2782 * flush_workqueue(md->wq). 2783 * flush_workqueue(md->wq).
2783 */ 2784 */
2784 set_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags); 2785 set_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags);
2785 synchronize_srcu(&md->io_barrier); 2786 if (map)
2787 synchronize_srcu(&md->io_barrier);
2786 2788
2787 /* 2789 /*
2788 * Stop md->queue before flushing md->wq in case request-based 2790 * Stop md->queue before flushing md->wq in case request-based
@@ -2802,7 +2804,8 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
2802 2804
2803 if (noflush) 2805 if (noflush)
2804 clear_bit(DMF_NOFLUSH_SUSPENDING, &md->flags); 2806 clear_bit(DMF_NOFLUSH_SUSPENDING, &md->flags);
2805 synchronize_srcu(&md->io_barrier); 2807 if (map)
2808 synchronize_srcu(&md->io_barrier);
2806 2809
2807 /* were we interrupted ? */ 2810 /* were we interrupted ? */
2808 if (r < 0) { 2811 if (r < 0) {