lkml.org 
[lkml]   [2002]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] Raceless module interface
Date
In message <E17pCKQ-0007Sz-00@starship> you write:
> Hi Roman,
>
> On Tuesday 10 September 2002 12:17, Roman Zippel wrote:
> > I implemented something like this some time ago. If module->count isn't
> > used by module.c anymore, why should it be in the module structure?
> > Consequently I removed it from the module struct (what breaks of course
> > unloading of all modules, so I'll probably reintroduce it with big a
> > warning). If the count isn't in the module structure, the locking will
> > become quite simpler. More info is here
> > http://marc.theaimsgroup.com/?l=linux-kernel&m=102754132716703&w=2
>
> Ah, I remember your original post but I didn't fully understand what you were

I hate people who can't be concise. It's a sign of sloppy thinking.

1) You only need reference counts if you want to unload a module.

2) A module can control its own reference counts safely if it does not
sleep without holding a reference, and you use the rcu patch's
synchronize_kernel() primitive.

3) Relying on *every* driver to control its own reference counts is a
recipe for disaster: some subsystems will want to control module
counts for their users.

4) Moving reference counts out of the module and into the particular
objects is *not* a good idea, since per-cpu cache-friendly
refcounting schemes are (almost by definition) about
SMP_CACHE_BYTES*NR_CPUS in size.

Hope I haven't missed anything,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:1.378 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site