All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: cleanup unreachable code
@ 2009-11-24 16:01 Corrado Zoccolo
  2009-11-24 19:36 ` Vivek Goyal
  2009-11-26  8:42 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Corrado Zoccolo @ 2009-11-24 16:01 UTC (permalink / raw)
  To: Linux-Kernel, Jens Axboe, Jeff Moyer, Vivek Goyal

cfq_should_idle returns false for no-idle queues that are not the last,
so the control flow will never reach the removed code in a state that
satisfies the if condition.
The unreachable code was added to emulate previous cfq behaviour for
non-NCQ rotational devices. My tests show that even without it, the
performances and fairness are comparable with previous cfq, thanks to
the fact that all seeky queues are grouped together, and that we idle at
the end of the tree.

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
---
 block/cfq-iosched.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d44f8a4..7144649 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1274,19 +1274,6 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
 	cfq_mark_cfqq_wait_request(cfqq);
 
 	sl = cfqd->cfq_slice_idle;
-	/* are we servicing noidle tree, and there are more queues?
-	 * non-rotational or NCQ: no idle
-	 * non-NCQ rotational : very small idle, to allow
-	 *     fair distribution of slice time for a process doing back-to-back
-	 *     seeks.
-	 */
-	if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD &&
-	    service_tree_for(cfqd->serving_prio, SYNC_NOIDLE_WORKLOAD, cfqd)
-		->count > 0) {
-		if (blk_queue_nonrot(cfqd->queue) || cfqd->hw_tag)
-			return;
-		sl = min(sl, msecs_to_jiffies(CFQ_MIN_TT));
-	}
 
 	mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
 	cfq_log_cfqq(cfqd, cfqq, "arm_idle: %lu", sl);
-- 
1.6.2.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cfq-iosched: cleanup unreachable code
  2009-11-24 16:01 [PATCH] cfq-iosched: cleanup unreachable code Corrado Zoccolo
@ 2009-11-24 19:36 ` Vivek Goyal
  2009-11-26  8:42 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Vivek Goyal @ 2009-11-24 19:36 UTC (permalink / raw)
  To: Corrado Zoccolo; +Cc: Linux-Kernel, Jens Axboe, Jeff Moyer

On Tue, Nov 24, 2009 at 05:01:49PM +0100, Corrado Zoccolo wrote:
> cfq_should_idle returns false for no-idle queues that are not the last,
> so the control flow will never reach the removed code in a state that
> satisfies the if condition.
> The unreachable code was added to emulate previous cfq behaviour for
> non-NCQ rotational devices. My tests show that even without it, the
> performances and fairness are comparable with previous cfq, thanks to
> the fact that all seeky queues are grouped together, and that we idle at
> the end of the tree.
> 

As you said that right now it is dead code, so better remove it.

Theoretically, by retaining this code we could benefit on non NCQ
rotational media if seek cost across the sync-noidle queues is higher
as compared to seek cost with-in queue. Fix it if we run into it.

Till then better to remove dead code.

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Thanks
Vivek

> Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
> ---
>  block/cfq-iosched.c |   13 -------------
>  1 files changed, 0 insertions(+), 13 deletions(-)
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index d44f8a4..7144649 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -1274,19 +1274,6 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
>  	cfq_mark_cfqq_wait_request(cfqq);
>  
>  	sl = cfqd->cfq_slice_idle;
> -	/* are we servicing noidle tree, and there are more queues?
> -	 * non-rotational or NCQ: no idle
> -	 * non-NCQ rotational : very small idle, to allow
> -	 *     fair distribution of slice time for a process doing back-to-back
> -	 *     seeks.
> -	 */
> -	if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD &&
> -	    service_tree_for(cfqd->serving_prio, SYNC_NOIDLE_WORKLOAD, cfqd)
> -		->count > 0) {
> -		if (blk_queue_nonrot(cfqd->queue) || cfqd->hw_tag)
> -			return;
> -		sl = min(sl, msecs_to_jiffies(CFQ_MIN_TT));
> -	}
>  
>  	mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
>  	cfq_log_cfqq(cfqd, cfqq, "arm_idle: %lu", sl);
> -- 
> 1.6.2.5
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cfq-iosched: cleanup unreachable code
  2009-11-24 16:01 [PATCH] cfq-iosched: cleanup unreachable code Corrado Zoccolo
  2009-11-24 19:36 ` Vivek Goyal
@ 2009-11-26  8:42 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-11-26  8:42 UTC (permalink / raw)
  To: Corrado Zoccolo; +Cc: Linux-Kernel, Jeff Moyer, Vivek Goyal

On Tue, Nov 24 2009, Corrado Zoccolo wrote:
> cfq_should_idle returns false for no-idle queues that are not the last,
> so the control flow will never reach the removed code in a state that
> satisfies the if condition.
> The unreachable code was added to emulate previous cfq behaviour for
> non-NCQ rotational devices. My tests show that even without it, the
> performances and fairness are comparable with previous cfq, thanks to
> the fact that all seeky queues are grouped together, and that we idle at
> the end of the tree.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-26  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 16:01 [PATCH] cfq-iosched: cleanup unreachable code Corrado Zoccolo
2009-11-24 19:36 ` Vivek Goyal
2009-11-26  8:42 ` 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.