lkml.org 
[lkml]   [2014]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH RESEND 1/3] percpu_ida: Fix data race on cpus_have_tags cpumask
From
On Tue, Mar 11, 2014 at 10:03 PM, Alexander Gordeev <agordeev@redhat.com> wrote:

>>
>> In theory, it still might cause percpu_ida_alloc(TASK_RUNNING) failed,
>> looks it isn't a big deal for the case.
>>
>> But I am wondering why cpumask_set_cpu() isn't called with
>> holding lock inside percpu_ida_free()? Looks 'nr_free == 1'
>> shouldn't have happened frequently.
>
> Because bouncing on the lock is more expensive than occasionally putting
> a thread into sleep.

I mean the below block can be put inside the previous lock:

if (nr_free == 1)
cpumask_set_cpu()

As I mentioned, 'nr_free == 1' doesn't happen frequently, so
it won't be big deal, will it?

Thanks,
--
Ming Lei


\
 
 \ /
  Last update: 2014-03-11 17:21    [W:0.104 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site