* [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any request
@ 2009-08-07 2:35 Gui Jianfeng
2009-08-11 6:22 ` Jens Axboe
2009-08-18 5:07 ` [PATCH] CFQ: get rid of must_alloc flag Gui Jianfeng
0 siblings, 2 replies; 6+ messages in thread
From: Gui Jianfeng @ 2009-08-07 2:35 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-kernel
Hi Jens,
CFQ judges whether must_alloc flag is set, but never marks this flag.
This patch set must_alloc flag when there is no request allocated by
a cfqq. This change ensures cfqq will get at least one request even
if the queue is full.
Hope it helps.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
block/cfq-iosched.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index fd7080e..531a404 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2279,6 +2279,9 @@ static void cfq_put_request(struct request *rq)
BUG_ON(!cfqq->allocated[rw]);
cfqq->allocated[rw]--;
+ if (!(cfqq->allocated[0] + cfqq->allocated[1]))
+ cfq_mark_cfqq_must_alloc(cfqq);
+
put_io_context(RQ_CIC(rq)->ioc);
rq->elevator_private = NULL;
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any request
2009-08-07 2:35 [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any request Gui Jianfeng
@ 2009-08-11 6:22 ` Jens Axboe
2009-08-18 5:07 ` [PATCH] CFQ: get rid of must_alloc flag Gui Jianfeng
1 sibling, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2009-08-11 6:22 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: linux-kernel
On Fri, Aug 07 2009, Gui Jianfeng wrote:
> Hi Jens,
>
> CFQ judges whether must_alloc flag is set, but never marks this flag.
> This patch set must_alloc flag when there is no request allocated by
> a cfqq. This change ensures cfqq will get at least one request even
> if the queue is full.
> Hope it helps.
The flag became redundant with the fix to not fail in set_request(). I
don't think your below patch is a very good idea, it would basically
mark any queue that has previously had a request allocated as a must
alloc queue. It would make more sense to mark an idling queue as must
alloc, since it's critical that this queue is allowed to allocate a
request once we idle a queue on its behalf. But we already check for the
wait_request flag in ->may_queue, so that part is already covered. So
I'd suggest we just delete any reference to must_alloc instead.
>
> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> ---
> block/cfq-iosched.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index fd7080e..531a404 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -2279,6 +2279,9 @@ static void cfq_put_request(struct request *rq)
> BUG_ON(!cfqq->allocated[rw]);
> cfqq->allocated[rw]--;
>
> + if (!(cfqq->allocated[0] + cfqq->allocated[1]))
> + cfq_mark_cfqq_must_alloc(cfqq);
> +
> put_io_context(RQ_CIC(rq)->ioc);
>
> rq->elevator_private = NULL;
> --
> 1.5.4.rc3
>
>
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] CFQ: get rid of must_alloc flag
2009-08-07 2:35 [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any request Gui Jianfeng
2009-08-11 6:22 ` Jens Axboe
@ 2009-08-18 5:07 ` Gui Jianfeng
2009-08-18 8:36 ` Jens Axboe
1 sibling, 1 reply; 6+ messages in thread
From: Gui Jianfeng @ 2009-08-18 5:07 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-kernel
Get rid of must_alloc flag since it's redundant now.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
block/cfq-iosched.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index fd7080e..f5770ad 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -191,7 +191,6 @@ enum cfqq_state_flags {
CFQ_CFQQ_FLAG_on_rr = 0, /* on round-robin busy list */
CFQ_CFQQ_FLAG_wait_request, /* waiting for a request */
CFQ_CFQQ_FLAG_must_dispatch, /* must be allowed a dispatch */
- CFQ_CFQQ_FLAG_must_alloc, /* must be allowed rq alloc */
CFQ_CFQQ_FLAG_must_alloc_slice, /* per-slice must_alloc flag */
CFQ_CFQQ_FLAG_fifo_expire, /* FIFO checked in this slice */
CFQ_CFQQ_FLAG_idle_window, /* slice idling enabled */
@@ -218,7 +217,6 @@ static inline int cfq_cfqq_##name(const struct cfq_queue *cfqq) \
CFQ_CFQQ_FNS(on_rr);
CFQ_CFQQ_FNS(wait_request);
CFQ_CFQQ_FNS(must_dispatch);
-CFQ_CFQQ_FNS(must_alloc);
CFQ_CFQQ_FNS(must_alloc_slice);
CFQ_CFQQ_FNS(fifo_expire);
CFQ_CFQQ_FNS(idle_window);
@@ -2229,8 +2227,7 @@ static void cfq_prio_boost(struct cfq_queue *cfqq)
static inline int __cfq_may_queue(struct cfq_queue *cfqq)
{
- if ((cfq_cfqq_wait_request(cfqq) || cfq_cfqq_must_alloc(cfqq)) &&
- !cfq_cfqq_must_alloc_slice(cfqq)) {
+ if ((cfq_cfqq_wait_request(cfqq) && !cfq_cfqq_must_alloc_slice(cfqq)) {
cfq_mark_cfqq_must_alloc_slice(cfqq);
return ELV_MQUEUE_MUST;
}
@@ -2317,7 +2314,6 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
}
cfqq->allocated[rw]++;
- cfq_clear_cfqq_must_alloc(cfqq);
atomic_inc(&cfqq->ref);
spin_unlock_irqrestore(q->queue_lock, flags);
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] CFQ: get rid of must_alloc flag
2009-08-18 5:07 ` [PATCH] CFQ: get rid of must_alloc flag Gui Jianfeng
@ 2009-08-18 8:36 ` Jens Axboe
2009-08-18 9:16 ` Gui Jianfeng
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2009-08-18 8:36 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: linux-kernel
On Tue, Aug 18 2009, Gui Jianfeng wrote:
> Get rid of must_alloc flag since it's redundant now.
I already queued an identical patch in for-2.6.32 a week ago:
http://git.kernel.dk/?p=linux-2.6-block.git;a=commitdiff;h=87783e4b0213b6b000108f17e2cd91045bee56f7;hp=37571a15498816c1a35f1dd2b68f7ddac5c50592
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] CFQ: get rid of must_alloc flag
2009-08-18 8:36 ` Jens Axboe
@ 2009-08-18 9:16 ` Gui Jianfeng
2009-08-18 12:15 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Gui Jianfeng @ 2009-08-18 9:16 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
Jens Axboe wrote:
> On Tue, Aug 18 2009, Gui Jianfeng wrote:
>> Get rid of must_alloc flag since it's redundant now.
>
> I already queued an identical patch in for-2.6.32 a week ago:
>
> http://git.kernel.dk/?p=linux-2.6-block.git;a=commitdiff;h=87783e4b0213b6b000108f17e2cd91045bee56f7;hp=37571a15498816c1a35f1dd2b68f7ddac5c50592
>
Ahh.. see, sorry for bothering.
--
Regards
Gui Jianfeng
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] CFQ: get rid of must_alloc flag
2009-08-18 9:16 ` Gui Jianfeng
@ 2009-08-18 12:15 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2009-08-18 12:15 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: linux-kernel
On Tue, Aug 18 2009, Gui Jianfeng wrote:
> Jens Axboe wrote:
> > On Tue, Aug 18 2009, Gui Jianfeng wrote:
> >> Get rid of must_alloc flag since it's redundant now.
> >
> > I already queued an identical patch in for-2.6.32 a week ago:
> >
> > http://git.kernel.dk/?p=linux-2.6-block.git;a=commitdiff;h=87783e4b0213b6b000108f17e2cd91045bee56f7;hp=37571a15498816c1a35f1dd2b68f7ddac5c50592
> >
>
> Ahh.. see, sorry for bothering.
Don't apologize, thanks for noticing!
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-18 12:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07 2:35 [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any request Gui Jianfeng
2009-08-11 6:22 ` Jens Axboe
2009-08-18 5:07 ` [PATCH] CFQ: get rid of must_alloc flag Gui Jianfeng
2009-08-18 8:36 ` Jens Axboe
2009-08-18 9:16 ` Gui Jianfeng
2009-08-18 12:15 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.