Re: Patch/resubmit linux-2.5.63-bk4 try_module_get simplification

Roman Zippel (zippel@linux-m68k.org)
Sun, 2 Mar 2003 19:37:09 +0100 (CET)


Hi,

On Sun, 2 Mar 2003, Adam J. Richter wrote:

> Is there enough traffic on the module reference counts to make
> this trade-off worthwhile?

I don't know, you have to ask that Rusty.
BTW the same trick is also possible with the old module count:

int try_inc_mod_count(struct module *mod)
{
int res;

if (mod) {
__MOD_INC_USE_COUNT(mod);
smp_mb__after_atomic_inc()
if (unlikely(mod->flags & MOD_DELETED))
goto check;
}
return 1;
check:
res = 1;
spin_lock(&unload_lock);
if (mod->flags & MOD_DELETED) {
__MOD_DEC_USE_COUNT(mod);
res = 0;
}
spin_unlock(&unload_lock);
return res;
}

(and a similiar change to sys_delete_module.)

bye, Roman

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