lkml.org 
[lkml]   [2010]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] introduce sys_membarrier(): process-wide memory barrier (v5)
* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Thu, 2010-01-21 at 11:07 -0500, Mathieu Desnoyers wrote:
> > * Peter Zijlstra (peterz@infradead.org) wrote:
>
> > We can even create a generic fallback with the following kind of code in
> > the meantime:
> >
> > static inline void spin_lock_mb(spinlock_t *lock)
> > {
> > spin_lock(&lock);
>
> That would be spin_lock(lock);
>
> > smp_mb();
> > }
> >
> > static inline void spin_unlock_mb(spinlock_t *lock)
> > {
> > smp_mb();
> > spin_unlock(&lock);
>
> and spin_unlock(lock);
>
> ;-)

Oh, right. I should think of integrating a compiler in my mail client ;)


>
> > }
> >
> > How does that sound ?
>
> You may also need spin_lock_irqsave, et al. variants too.

Yep, or we simply use the local_irq_save/restore separately. That could
be a good idea given that only few specialized sites are affected.

Thanks,

Mathieu

>
> -- Steve
>
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2010-01-21 17:25    [W:0.092 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site