lkml.org 
[lkml]   [2003]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] small fixes in brlock.h
On Sun, 9 Mar 2003, Robert Love wrote:

> On Sun, 2003-03-09 at 18:44, Zwane Mwaikambo wrote:
>
> > --- linux-2.5.64-unwashed/include/linux/brlock.h 5 Mar 2003 05:07:54 -0000 1.1.1.1
> > +++ linux-2.5.64-unwashed/include/linux/brlock.h 9 Mar 2003 23:42:26 -0000
> > @@ -85,8 +85,7 @@
> > if (idx >= __BR_END)
> > __br_lock_usage_bug();
> >
> > - preempt_disable();
> > - _raw_read_lock(&__brlock_array[smp_processor_id()][idx]);
> > + read_lock(&__brlock_array[smp_processor_id()][idx]);
> > }
>
> This is wrong.

I was waiting for this ;)

> We have to disable preemption prior to reading smp_processor_id().
> Otherwise we may lock/unlock the wrong processor's brlock. The above as
> you changed it is equivalent to:
>
> cpu = smp_processor_id();
> /* do not want to preempt here, but we can! */
> preempt_disable();
> _raw_read_lock(&__brlock_array[cpu][idx]);

How are we able to preempt there? Timer tick?

Thanks,
Zwane
--
function.linuxpower.ca
-
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.122 / U:2.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site