From: "Thomas Maier" <balagi@justmail.de>
To: linux-kernel@vger.kernel.org
Cc: petero2@telia.com, akpm@osdl.org, "Jens Axboe" <jens.axboe@oracle.com>
Subject: [PATCH 1/2] 2.6.19-rc2-mm1 ll_rw_blk.c: export clear_queue_congested and set_queue_congested
Date: Tue, 17 Oct 2006 21:42:12 +0200 [thread overview]
Message-ID: <op.thkzomdriudtyh@master> (raw)
[-- Attachment #1: Type: text/plain, Size: 414 bytes --]
Hello,
this patch exports the clear_queue_congested()
and set_queue_congested() functions located in ll_rw_blk.c
The functions are renamed to blk_clear_queue_congested()
and blk_set_queue_congested().
(needed in the pktcdvd driver's bio write congestion control)
(have the bits set with set_queue_congested() any use?
seems they are never used by anyone....)
Signed-off-by: Thomas Maier <balagi@justmail.de>
[-- Attachment #2: 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1.patch --]
[-- Type: application/octet-stream, Size: 3445 bytes --]
diff -urpN linux-2.6.19-rc2-mm1.blk/block/ll_rw_blk.c 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/block/ll_rw_blk.c
--- linux-2.6.19-rc2-mm1.blk/block/ll_rw_blk.c 2006-10-17 21:20:42.000000000 +0200
+++ 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/block/ll_rw_blk.c 2006-10-17 21:17:21.000000000 +0200
@@ -117,7 +117,7 @@ static void blk_queue_congestion_thresho
* congested queues, and wake up anyone who was waiting for requests to be
* put back.
*/
-static void clear_queue_congested(request_queue_t *q, int rw)
+void blk_clear_queue_congested(request_queue_t *q, int rw)
{
enum bdi_state bit;
wait_queue_head_t *wqh = &congestion_wqh[rw];
@@ -129,11 +129,13 @@ static void clear_queue_congested(reques
wake_up(wqh);
}
+EXPORT_SYMBOL(blk_clear_queue_congested);
+
/*
* A queue has just entered congestion. Flag that in the queue's VM-visible
* state flags and increment the global gounter of congested queues.
*/
-static void set_queue_congested(request_queue_t *q, int rw)
+void blk_set_queue_congested(request_queue_t *q, int rw)
{
enum bdi_state bit;
@@ -141,6 +143,8 @@ static void set_queue_congested(request_
set_bit(bit, &q->backing_dev_info.state);
}
+EXPORT_SYMBOL(blk_set_queue_congested);
+
/**
* blk_get_backing_dev_info - get the address of a queue's backing_dev_info
* @bdev: device
@@ -2066,7 +2070,7 @@ static void __freed_request(request_queu
struct request_list *rl = &q->rq;
if (rl->count[rw] < queue_congestion_off_threshold(q))
- clear_queue_congested(q, rw);
+ blk_clear_queue_congested(q, rw);
if (rl->count[rw] + 1 <= q->nr_requests) {
if (waitqueue_active(&rl->wait[rw]))
@@ -2136,7 +2140,7 @@ static struct request *get_request(reque
}
}
}
- set_queue_congested(q, rw);
+ blk_set_queue_congested(q, rw);
}
/*
@@ -3824,14 +3828,14 @@ queue_requests_store(struct request_queu
blk_queue_congestion_threshold(q);
if (rl->count[READ] >= queue_congestion_on_threshold(q))
- set_queue_congested(q, READ);
+ blk_set_queue_congested(q, READ);
else if (rl->count[READ] < queue_congestion_off_threshold(q))
- clear_queue_congested(q, READ);
+ blk_clear_queue_congested(q, READ);
if (rl->count[WRITE] >= queue_congestion_on_threshold(q))
- set_queue_congested(q, WRITE);
+ blk_set_queue_congested(q, WRITE);
else if (rl->count[WRITE] < queue_congestion_off_threshold(q))
- clear_queue_congested(q, WRITE);
+ blk_clear_queue_congested(q, WRITE);
if (rl->count[READ] >= q->nr_requests) {
blk_set_queue_full(q, READ);
diff -urpN linux-2.6.19-rc2-mm1.blk/include/linux/blkdev.h 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/include/linux/blkdev.h
--- linux-2.6.19-rc2-mm1.blk/include/linux/blkdev.h 2006-10-17 21:20:42.000000000 +0200
+++ 1-export-queue-congestion-ll_rw_blk-2.6.19-rc2-mm1/include/linux/blkdev.h 2006-10-17 21:17:21.000000000 +0200
@@ -651,6 +651,8 @@ extern void blk_recount_segments(request
extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
extern int sg_scsi_ioctl(struct file *, struct request_queue *,
struct gendisk *, struct scsi_ioctl_command __user *);
+extern void blk_clear_queue_congested(request_queue_t *q, int rw);
+extern void blk_set_queue_congested(request_queue_t *q, int rw);
extern void blk_start_queue(request_queue_t *q);
extern void blk_stop_queue(request_queue_t *q);
extern void blk_sync_queue(struct request_queue *q);
next reply other threads:[~2006-10-17 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-17 19:42 Thomas Maier [this message]
2006-10-17 20:39 ` [PATCH 1/2] 2.6.19-rc2-mm1 ll_rw_blk.c: export clear_queue_congested and set_queue_congested Andrew Morton
2006-10-17 21:10 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.thkzomdriudtyh@master \
--to=balagi@justmail.de \
--cc=akpm@osdl.org \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=petero2@telia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox