Linux Kernels

dm: cleanup dm_any_congested()

This change “dm: cleanup dm_any_congested()” (commit e522c03) in Linux kernel is authored by Mike Snitzer <snitzer [at] redhat.com> on Tue Feb 2 22:35:06 2016 -0500.

Description of "dm: cleanup dm_any_congested()"

The change “dm: cleanup dm_any_congested()” introduces changes as follows.

dm: cleanup dm_any_congested()

The request-based DM support for checking queue congestion doesn't
require access to the live DM table.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

Linux kernel releases containing commit e522c03

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "dm: cleanup dm_any_congested()"

There are 17 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/md/dm.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
 
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 30302df20201..d605170a02d9 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2137,19 +2137,18 @@ static int dm_any_congested(void *congested_data, int bdi_bits)
 	struct dm_table *map;
 
 	if (!test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) {
-		map = dm_get_live_table_fast(md);
-		if (map) {
+		if (dm_request_based(md)) {
 			/*
-			 * Request-based dm cares about only own queue for
-			 * the query about congestion status of request_queue
+			 * With request-based DM we only need to check the
+			 * top-level queue for congestion.
 			 */
-			if (dm_request_based(md))
-				r = md->queue->backing_dev_info.wb.state &
-				    bdi_bits;
-			else
+			r = md->queue->backing_dev_info.wb.state & bdi_bits;
+		} else {
+			map = dm_get_live_table_fast(md);
+			if (map)
 				r = dm_table_any_congested(map, bdi_bits);
+			dm_put_live_table_fast(md);
 		}
-		dm_put_live_table_fast(md);
 	}
 
 	return r;

The commit for this change in Linux stable tree is e522c03 (patch).

Last modified: 2020/01/11 06:53