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, 10 Jun 2009 13:59:30 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Shan Wei <shanwei@...fujitsu.com>
Cc:	Jens Axboe <jens.axboe@...cle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] CFQ:optimize the cfq_should_preempt()

Shan Wei <shanwei@...fujitsu.com> writes:

> The patch don't fix bug, just optimizes the cfq_should_preempt()
> to preempt higher priority queue.
>
> Additionally, the comment above cfq_preempt_queue() is outdated.
>
>
> Signed-off-by: Shan Wei <shanwei@...fujitsu.com>
> ---
>  block/cfq-iosched.c |   17 +++++------------
>  1 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index a55a9bd..427f522 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -1993,10 +1993,10 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
>  	if (cfq_slice_used(cfqq))
>  		return 1;
>  
> -	if (cfq_class_idle(new_cfqq))
> -		return 0;
> -
> -	if (cfq_class_idle(cfqq))
> +	/*
> +	 * if new_cfqq is of higher priority, preempting the active queue.
> +	 */
> +	if (new_cfqq->ioprio_class < cfqq->ioprio_class)
>  		return 1;

Prior to this patch, if both queues were idle, the first if statement
would evaluate to true and we would return 0.  With your patch, we fall
through to the rest of the logic in the function.  In such a case, I
don't think this is an optimiation.  I can't say how likely this is to
happen, though.

What other justfication do you have for this change?  Were you able to
measure a performance difference?

Cheers,
Jeff
--
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