lkml.org 
[lkml]   [2011]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] CPU hotplug, freezer: Fix bugs in CPU hotplug call path
On 10/03/2011 03:33 PM, Peter Zijlstra wrote:
> On Mon, 2011-10-03 at 01:14 +0530, Srivatsa S. Bhat wrote:
>> +static atomic_t tasks_frozen = ATOMIC_INIT(0);
>> +
>> +void set_tasks_frozen_flag(void)
>> +{
>> + atomic_set(&tasks_frozen, 1);
>> +}
>> +
>> +void clear_tasks_frozen_flag(void)
>> +{
>> + atomic_set(&tasks_frozen, 0);
>> +}
>> +
>> +int tasks_are_frozen(void)
>> +{
>> + int ret;
>> + ret = atomic_read(&tasks_frozen);
>> + return ret;
>> +}
>
> What's the point of using atomic_t here? Neither set nor read are
> actually atomic ops.
>

Hi Peter,
Thank you for the review. I'll send version 2 of the patch with
the changes incorporated.

--
Regards,
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Linux Technology Center,
IBM India Systems and Technology Lab


\
 
 \ /
  Last update: 2011-10-04 15:21    [W:0.053 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site