Re: owner field in `struct fs'

Rusty Russell (rusty@linuxcare.com.au)
Tue, 27 Jun 2000 16:46:35 +1000


In message <14653.962013405@cygnus.co.uk> you write:
>
> rusty@linuxcare.com.au said:
> > Adding a field to every registerable structure is gross. The
> > responsibility for getting modules right should be with the person
> > writing the modules. The rules are simple; and people w/o module
> > support don't pay the penalty for the extra field everywhere...
>
> It's possible to have the module use count maintained from outside the
> driver without having the extra structure.
>
> Take a look at put_module_symbol() in kernel/module.c. It doesn't require
> any argument other than the address of the function, and it can find the
> module quite happily.

Cute, but paying that penalty for every open() on a filesystem which
isn't a module (true for 99%, ext2 root) seems a little harsh. Hmm,
could be cached, but Al's solution has the advantage of not making me
want to barf...

> While we're at it - can we get rid of MOD_INC_USE_COUNT and
> __MOD_INC_USE_COUNT altogether to force people to be aware of the need for
> try_inc_mod_count and checking its return value? First thing in 2.5 along
> with removing sleep_on() ?

Are you volunteering to go through net/ipv4/netfilter/ and change them
all? Because that'd be really great!

For 2.5, I'd prefer the two-stage cleanup solution, because it is easy
for module writers to understand (`deactivate' deregisters so that
module counts won't increase after sys_del_module syncs bhs, `cleanup'
frees resources), allows module counts to increment inside interrupt
handlers, is simple to write assertions to check behaviour, and for
code like mine, avoids the ugly `loop and schedule()' in cleanup().

But that's a long way away, and getting furthur,
Rusty.

--
Hacking time.

- 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/