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:	Tue, 8 Feb 2011 14:48:26 -0500
From:	Vivek Goyal <>
To:	Justin TerAvest <>
Subject: Re: [PATCH] Don't wait if queue already has requests.

On Tue, Feb 08, 2011 at 11:18:17AM -0800, Justin TerAvest wrote:
> Commit 7667aa0630407bc07dc38dcc79d29cc0a65553c1 added logic to wait for
> the last queue of the group to become busy (have at least one request),
> so that the group does not lose out for not being continuously
> backlogged. The commit did not check for the condition that the last
> queue already has some requests. As a result, if the queue already has
> requests, wait_busy is set. Later on, cfq_select_queue() checks the
> flag, and decides that since the queue has a request now and wait_busy
> is set, the queue is expired.  This results in early expiration of the
> queue.

Hi Justin,

wait_busy will be set only if slice has expired or about to be expired. So
even if we are setting wait_busy flag, it is not a huge deal even if
select_queue() expires it? Anyway queue has consumed or almost consumed
its allocated slice?

Having said that, it does not make sense to set wait_busy flag if
cfqq has requests. So I would be fine with the patch. I am just
curious that how did you see a difference in practice.

> This patch fixes the problem by adding a check to see if queue already
> has requests. If it does, wait_busy is not set. As a result, time slices
> do not expire early.
> The queues with more than one request are usually buffered writers.
> Testing shows improvement in isolation between buffered writers.

Upstream code puts all the buffered WRITES in root cgroup. So there
is no isolation between buffered WRITES?


> Signed-off-by: Justin TerAvest <>
> ---
>  block/cfq-iosched.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 501ffdf..5dcc353 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -3432,6 +3432,10 @@ static bool cfq_should_wait_busy(struct cfq_data *cfqd, struct cfq_queue *cfqq)
>  {
>  	struct cfq_io_context *cic = cfqd->active_cic;
> +	/* If the queue already has requests, don't wait */
> +	if (!RB_EMPTY_ROOT(&cfqq->sort_list))
> +		return false;
> +
>  	/* If there are other queues in the group, don't wait */
>  	if (cfqq->cfqg->nr_cfqq > 1)
>  		return false;
> -- 
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists