lkml.org 
[lkml]   [2010]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 07/10] module: __rcu annotations
Date
On Wednesday 24 February 2010, Alexey Dobriyan wrote:
> On Wed, Feb 24, 2010 at 09:04:03PM +0100, Arnd Bergmann wrote:
> > @@ -360,10 +360,12 @@ struct module *find_module(const char *name)
> > {
> > struct module *mod;
> >
> > - list_for_each_entry(mod, &modules, list) {
> > + rcu_read_lock();
> > + list_for_each_entry_rcu(mod, &modules, list) {
> > if (strcmp(mod->name, name) == 0)
> > return mod;
> > }
> > + rcu_read_unlock();
> > return NULL;
> > }
> > EXPORT_SYMBOL_GPL(find_module);
>
> modules list is under module_mutex, nothing should be done here.

Ok, this is a significant limitation of the list rcu annotation
then, it's not possible to pass the same list into list_for_each_entry
and list_for_each_entry_rcu with the way I changed the rcu list
definition. I would be possible to do a __list_for_each_entry_rcu
macro that takes an rcu_list_head but does not actually use
rcu_dereference, but I'm not sure if that's good enough.

Arnd



\
 
 \ /
  Last update: 2010-02-24 21:41    [W:0.080 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site