lkml.org 
[lkml]   [2003]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch/resubmit linux-2.5.63-bk4 try_module_get simplification
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/

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