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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Apr 2012 11:55:25 +0530
From:	Venkatraman S <svenkatr@...com>
To:	<linux-kernel@...r.kernel.org>, <linux-mmc@...r.kernel.org>
CC:	<arnd.bergmann@...aro.org>, <cjb@...top.org>,
	<alex.limberg@...disk.com>, <ilan.smith@...disk.com>,
	<lporzio@...ron.com>, Alex Lemberg <alex.lemberg@...disk.com>,
	Venkatraman S <svenkatr@...com>
Subject: [RFC PATCH 04/11] block: Expedite DMPG and SWAPIN requests ahead of the queue

From: Ilan Smith <ilan.smith@...disk.com>

When expedite_swapin and expedite_dmpg are set, move the
requests ahead of the queue.

Signed-off-by: Ilan Smith <ilan.smith@...disk.com>
Signed-off-by: Alex Lemberg <alex.lemberg@...disk.com>
Signed-off-by: Venkatraman S <svenkatr@...com>
---
 block/blk-core.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index 3a78b00..0b54ee9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1305,6 +1305,12 @@ void init_request_from_bio(struct request *req, struct bio *bio)
 	if (bio->bi_rw & REQ_RAHEAD)
 		req->cmd_flags |= REQ_FAILFAST_MASK;
 
+	if (bio_swapin(bio) && blk_queue_exp_swapin(req->q))
+		req->cmd_flags |= REQ_RW_SWAPIN;
+
+	if (bio_dmpg(bio) && blk_queue_exp_dmpg(req->q))
+		req->cmd_flags |= REQ_RW_DMPG;
+
 	req->errors = 0;
 	req->__sector = bio->bi_sector;
 	req->ioprio = bio_prio(bio);
@@ -1332,6 +1338,18 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
 		goto get_rq;
 	}
 
+	if (bio_swapin(bio) && blk_queue_exp_swapin(q)) {
+		spin_lock_irq(q->queue_lock);
+		where = ELEVATOR_INSERT_FRONT;
+		goto get_rq;
+	}
+
+	if (bio_dmpg(bio) && blk_queue_exp_dmpg(q)) {
+		spin_lock_irq(q->queue_lock);
+		where = ELEVATOR_INSERT_FRONT;
+		goto get_rq;
+	}
+
 	/*
 	 * Check if we can merge with the plugged list before grabbing
 	 * any locks.
-- 
1.7.10.rc2

--
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