public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] CFQ: mark must_alloc flag when a cfqq doesn't allocate any  request
Date: Tue, 11 Aug 2009 08:22:43 +0200	[thread overview]
Message-ID: <20090811062243.GP12579@kernel.dk> (raw)
In-Reply-To: <4A7B930D.6060206@cn.fujitsu.com>

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


  reply	other threads:[~2009-08-11 12:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20090811062243.GP12579@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /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