lkml.org 
[lkml]   [2012]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/3] task_work_add: generic process-context callbacks
probably I should also comment this part...

On 04/13, Linus Torvalds wrote:
>
> Alternatively, you must make the rule be that the data can only be
> freed by the caller *if* it was returned from "task_work_cancel()".

Exactly.

Once the caller does task_work_add(twork), it no longer "owns" this
twork.

But, if task_work_cancel() succeeds - you own it again.

> But then you can't allocate it on the stack any more, and have to
> allocate it separately.

Yes, unless you do task_work_add/cancel(current).

Oleg.



\
 
 \ /
  Last update: 2012-04-14 05:43    [W:0.073 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site