> On Mon, 26 Jun 2000 13:48:14 -0400 (EDT),
> Alexander Viro <viro@math.psu.edu> wrote:
> >Erm... There is one case when MOD_INC_USE_COUNT is kosher and even needed,
> >but it's pretty convoluted. Consider modules A, B and C.
> > A provides register_foo() and unregister_foo()
> > B provides foo1
> > C does register_foo(&foo1) and unregister_foo(&foo1) for ioctls on
> >some device.
> >
> >Notice that C depends on A and B, but A and B are independent. However,
> >once foo1 is registered we want A to be pinned down. MOD_INC_USE_COUNT in
> >register_foo() is OK here - C depends on A and if we have C around the A
> >will stay there...
>
> No need. A does EXPORT_SYMBOL(register_foo), C has an unresolved
> symbol reference to register_foo. sys_init_module() sets mod->refs on
> A pointing to C, sys_delete_module() will not unload A as long as C is
> loaded.
Yes?
fd=open("/dev/foo") C loaded, A and B pinned down.
ioctl(fd, SPLAT, 0) register_foo(&foo1), foo1 registered in A.
close(fd)
rmmod C
rmmod A
woops...
> AFAICT, pinning modules by symbol reference is race safe, all the work
> is done in module.c under BKL.
BKL on _caller_ of ->open() and ->release() is going to hell. It's one of
the major contention points, so it will be shifted into methods themselves
and disappear in case of quite a few filesystem ones (devices will have
it, indeed, but the most frequent case is ext2_open()/ext2_release()).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/