lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [this_cpu_xx V7 7/8] Module handling: Use this_cpu_xx to dynamically allocate counters
Date
On Tue, 15 Dec 2009 02:33:50 pm Tejun Heo wrote:
> (Rusty Russell cc'd.)
>
> On 12/15/2009 07:03 AM, Christoph Lameter wrote:
> > @@ -479,15 +467,15 @@ static inline int try_module_get(struct
> > int ret = 1;
> >
> > if (module) {
> > - unsigned int cpu = get_cpu();
> > if (likely(module_is_live(module))) {
> > - local_inc(__module_ref_addr(module, cpu));
> > + preempt_disable();
> > + __this_cpu_inc(module->refptr->count);
> > trace_module_get(module, _THIS_IP_,
> > - local_read(__module_ref_addr(module, cpu)));
> > + __this_cpu_read(module->refptr->count));
> > + preempt_enable();
> > }
> > else
> > ret = 0;
> > - put_cpu();
>
> I think you need preemption disabled while checking whether
> module_is_live(). The state is protected by stop_machine or
> synchronize_sched().

Yes.

Thanks,
Rusty.


\
 
 \ /
  Last update: 2009-12-15 23:43    [W:0.206 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site