public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: don't access jiffies when initialising io_context
@ 2010-03-01  9:53 Richard Kennedy
  2010-03-01  9:56 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Kennedy @ 2010-03-01  9:53 UTC (permalink / raw)
  To: Jens Axboe; +Cc: lkml

As the comment says the initial value of last_waited is never used, so
there is no need to initialise it with the current jiffies. Jiffies is
hot enough without accessing it for no reason.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
---
patch against 2.6.33
compiled & tested on x86_64

diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 98e6bf6..3f65c8a 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -91,7 +91,7 @@ struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
 		spin_lock_init(&ret->lock);
 		ret->ioprio_changed = 0;
 		ret->ioprio = 0;
-		ret->last_waited = jiffies; /* doesn't matter... */
+		ret->last_waited = 0; /* doesn't matter... */
 		ret->nr_batch_requests = 0; /* because this is 0 */
 		INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
 		INIT_HLIST_HEAD(&ret->cic_list);



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

* Re: [PATCH] block: don't access jiffies when initialising io_context
  2010-03-01  9:53 [PATCH] block: don't access jiffies when initialising io_context Richard Kennedy
@ 2010-03-01  9:56 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2010-03-01  9:56 UTC (permalink / raw)
  To: Richard Kennedy; +Cc: lkml

On Mon, Mar 01 2010, Richard Kennedy wrote:
> As the comment says the initial value of last_waited is never used, so
> there is no need to initialise it with the current jiffies. Jiffies is
> hot enough without accessing it for no reason.

Applied, though it will not make a huge difference in any way.
alloc_io_context() only gets called the first time a process does IO, so
it's not a hot path.

> 
> Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
> ---
> patch against 2.6.33
> compiled & tested on x86_64
> 
> diff --git a/block/blk-ioc.c b/block/blk-ioc.c
> index 98e6bf6..3f65c8a 100644
> --- a/block/blk-ioc.c
> +++ b/block/blk-ioc.c
> @@ -91,7 +91,7 @@ struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
>  		spin_lock_init(&ret->lock);
>  		ret->ioprio_changed = 0;
>  		ret->ioprio = 0;
> -		ret->last_waited = jiffies; /* doesn't matter... */
> +		ret->last_waited = 0; /* doesn't matter... */
>  		ret->nr_batch_requests = 0; /* because this is 0 */
>  		INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
>  		INIT_HLIST_HEAD(&ret->cic_list);
> 
> 

-- 
Jens Axboe


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

end of thread, other threads:[~2010-03-01  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01  9:53 [PATCH] block: don't access jiffies when initialising io_context Richard Kennedy
2010-03-01  9:56 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox