Re: [PATCH 5/9] kernel: abstract out task work helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/20/20 2:07 PM, Peter Zijlstra wrote:
> On Thu, Feb 20, 2020 at 01:31:47PM -0700, Jens Axboe wrote:
> 
>> @@ -27,39 +43,25 @@ static struct callback_head work_exited; /* all we need is ->next == NULL */
>>  int
>>  task_work_add(struct task_struct *task, struct callback_head *work, bool notify)
>>  {
>> -	struct callback_head *head;
>> +	int ret;
>>  
>> -	do {
>> -		head = READ_ONCE(task->task_works);
>> -		if (unlikely(head == &work_exited))
>> -			return -ESRCH;
>> -		work->next = head;
>> -	} while (cmpxchg(&task->task_works, head, work) != head);
>> +	ret = __task_work_add(task, &task->task_works, work);
>>  
>>  	if (notify)
> 
> 	if (!ret && notify)

Good catch, thanks! Fixed up.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux