lkml.org 
[lkml]   [2009]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: When it is save to kfree() hrtimer object?
On Mon, 7 Dec 2009, Nikita V. Youshchenko wrote:
> - Isn't it a bug that timer object is accessed after it's callback was
> called and returned HRTIMER_NORESTART?

No, it's not. It's deliberately implemented that way.

> - If that is not a bug, then when it is "officially safe" to deallocate
> struct hrtimer object?

When it's neither enqueued nor running the callback. See the other use
sites.

> - Are there any recommendations on how to implement "single-shot" timers
> like in my case?

Well, you wake up something which waits on completion of that request,
right ? Probably the caller which issued the request. Why don't you
free the request in the waiter context after it got woken up ?

Thanks,

tglx


\
 
 \ /
  Last update: 2009-12-07 11:39    [W:0.026 / U:30.984 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site