lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Mar 2009 11:36:50 +0100
From:	Jerome Marchand <jmarchan@...hat.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	Jens Axboe <axboe@...nel.dk>
Subject: [PATCH] block: forbid to re-enable I/O stat accounting

When we stop I/O stat accounting we stop to update the in-flight
requests counter and we need this counter to be reliable for
accounting I/O stats. Unfortunately updating in_flight field may
affect performance. So, until we have a better solution, just forbid
to re-enable I/O stat accounting after it has been disabled.

Signed-off-by: Jerome Marchand <jmarchan@...hat.com>
---
 block/blk-sysfs.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e29ddfc..2903874 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -208,12 +208,15 @@ static ssize_t queue_iostats_store(struct request_queue *q, const char *page,
 	unsigned long stats;
 	ssize_t ret = queue_var_store(&stats, page, count);
 
-	spin_lock_irq(q->queue_lock);
-	if (stats)
-		queue_flag_set(QUEUE_FLAG_IO_STAT, q);
-	else
+	/*
+	 * When we disable io stat accounting we stop tracking essential data,
+	 * so don't allow to reenable it as it would lead to inconsistency.
+	 */
+	if (!stats) {
+		spin_lock_irq(q->queue_lock);
 		queue_flag_clear(QUEUE_FLAG_IO_STAT, q);
-	spin_unlock_irq(q->queue_lock);
+		spin_unlock_irq(q->queue_lock);
+	}
 
 	return ret;
 }
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ