login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
24
Re: [PATCH 4/6] block: cfq: make the io contect sharing lockless
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Paul E. McKenney <paulmck@...>
To: Andrew Morton <akpm@...>
Cc: Jens Axboe <jens.axboe@...>, <linux-kernel@...>, <knikanth@...>
Subject:
Re: [PATCH 4/6] block: cfq: make the io contect sharing lockless
Date: Thursday, January 24, 2008 - 12:42 pm
On Wed, Jan 23, 2008 at 02:08:19PM -0800, Andrew Morton wrote:
quoted text
> > On Tue, 22 Jan 2008 10:49:19 +0100 Jens Axboe <jens.axboe@oracle.com> wrote: > > The io context sharing introduced a per-ioc spinlock, that would protect > > the cfq io context lookup. That is a regression from the original, since > > we never needed any locking there because the ioc/cic were process private. > > > > The cic lookup is changed from an rbtree construct to a radix tree, which > > we can then use RCU to make the reader side lockless. That is the performance > > critical path, modifying the radix tree is only done on process creation > > (when that process first does IO, actually) and on process exit (if that > > process has done IO). > > Perhaps Paul would review the rcu usage here sometime?
I will take a look -- long plane trip about 36 hours from now. ;-) Thanx, Paul
quoted text
> > +/* > > + * Add cic into ioc, using cfqd as the search key. This enables us to lookup > > + * the process specific cfq io context when entered from the block layer. > > + * Also adds the cic to a per-cfqd list, used when this queue is removed. > > + */ > > +static inline int > > There's a lot of pointless inlining in there. > > > +++ b/block/ll_rw_blk.c > > @@ -3831,6 +3831,16 @@ int __init blk_dev_init(void) > > return 0; > > } > > > > +static void cfq_dtor(struct io_context *ioc) > > +{ > > + struct cfq_io_context *cic[1]; > > + int r; > > + > > + r = radix_tree_gang_lookup(&ioc->radix_root, (void **) cic, 0, 1); > > + if (r > 0) > > + cic[0]->dtor(ioc); > > +} > > Some comments here might help others who are wondering why we can't just > use radix_tree_lookup(). > > > +static void cfq_exit(struct io_context *ioc) > > +{ > > + struct cfq_io_context *cic[1]; > > + int r; > > + > > + rcu_read_lock(); > > + r = radix_tree_gang_lookup(&ioc->radix_root, (void **) cic, 0, 1); > > + rcu_read_unlock(); > > + > > + if (r > 0) > > + cic[0]->exit(ioc); > > +} > > ditto. > > > /* Called by the exitting task */ > > void exit_io_context(void) > > { > > struct io_context *ioc; > > - struct cfq_io_context *cic; > > > > task_lock(current); > > ioc = current->io_context; > > @@ -3876,11 +3891,7 @@ void exit_io_context(void) > > if (atomic_dec_and_test(&ioc->nr_tasks)) { > > if (ioc->aic && ioc->aic->exit) > > ioc->aic->exit(ioc->aic); > > - if (ioc->cic_root.rb_node != NULL) { > > - cic = rb_entry(rb_first(&ioc->cic_root), > > - struct cfq_io_context, rb_node); > > - cic->exit(ioc); > > - } > > + cfq_exit(ioc); > > > > put_io_context(ioc); > > } > > @@ -3900,7 +3911,7 @@ struct io_context *alloc_io_context(gfp_t gfp_flags, int node) > > ret->last_waited = jiffies; /* doesn't matter... */ > > ret->nr_batch_requests = 0; /* because this is 0 */ > > ret->aic = NULL; > > - ret->cic_root.rb_node = NULL; > > + INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH); > > Did this need to be atomic? > >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/6] IO context sharing
, Jens Axboe
, (Tue Jan 22, 5:49 am)
Re: [PATCH 0/6] IO context sharing
, David Chinner
, (Tue Jan 22, 11:50 pm)
Re: [PATCH 0/6] IO context sharing
, Andi Kleen
, (Wed Jan 23, 4:44 am)
Re: [PATCH 0/6] IO context sharing
, Peter Zijlstra
, (Tue Jan 22, 10:49 am)
Re: [PATCH 0/6] IO context sharing
, Jens Axboe
, (Tue Jan 22, 2:21 pm)
[PATCH 4/6] block: cfq: make the io contect sharing lockless
, Jens Axboe
, (Tue Jan 22, 5:49 am)
Re: [PATCH 4/6] block: cfq: make the io contect sharing lock...
, Andrew Morton
, (Wed Jan 23, 6:08 pm)
Re: [PATCH 4/6] block: cfq: make the io contect sharing lock...
, Paul E. McKenney
, (Thu Jan 24, 12:42 pm)
Re: [PATCH 4/6] block: cfq: make the io contect sharing lock...
, Jens Axboe
, (Thu Jan 24, 3:36 am)
[PATCH 6/6] kernel: add CLONE_IO to specifically request sha...
, Jens Axboe
, (Tue Jan 22, 5:49 am)
[PATCH 5/6] io_context sharing - anticipatory changes
, Jens Axboe
, (Tue Jan 22, 5:49 am)
[PATCH 1/6] ioprio: move io priority from task_struct to io_...
, Jens Axboe
, (Tue Jan 22, 5:49 am)
Re: [PATCH 1/6] ioprio: move io priority from task_struct to...
, Andrew Morton
, (Wed Jan 23, 6:07 pm)
Re: [PATCH 1/6] ioprio: move io priority from task_struct to...
, Jens Axboe
, (Thu Jan 24, 3:30 am)
[PATCH 2/6] io context sharing: preliminary support
, Jens Axboe
, (Tue Jan 22, 5:49 am)
Re: [PATCH 2/6] io context sharing: preliminary support
, Andrew Morton
, (Wed Jan 23, 6:08 pm)
Re: [PATCH 2/6] io context sharing: preliminary support
, Jens Axboe
, (Thu Jan 24, 3:36 am)
[PATCH 3/6] io_context sharing - cfq changes
, Jens Axboe
, (Tue Jan 22, 5:49 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Linus Torvalds
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Paul Jackson
Re: [patch 2/2] cpusets: add interleave_over_allowed option
Linus Torvalds
Re: 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes g...
git
:
linux-netdev
:
Mark Lord
Re: 2.6.25-rc8: FTP transfer errors
Gerrit Renker
[PATCH 0/37] dccp: Feature negotiation - last call for comments
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
811 guests
online.
Online users
strcmp
Syndicate