lkml.org 
[lkml]   [2014]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] UBI: Fastmap: Ensure that only one fastmap work is scheduled
Am 30.09.2014 08:45, schrieb Bityutskiy, Artem:
> On Tue, 2014-09-30 at 00:20 +0200, Richard Weinberger wrote:
>> + spin_lock(&ubi->wl_lock);
>> + ubi->fm_work_scheduled = 0;
>> + spin_unlock(&ubi->wl_lock);
>
> Andrew Morton once said me that if I am protecting an integer change
> like this with a spinlock, I have a problem in my locking design. He was
> right for my particular case.
>
> Integer is changes atomic. The only other thing spinlock adds are the
> barriers.

I've added the spinlock to have a barrier in any case.

Thanks,
//richard


\
 
 \ /
  Last update: 2014-09-30 09:41    [W:0.076 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site