Messages in this thread | | | Date | Mon, 7 Dec 2009 11:35:31 +0100 (CET) | From | Thomas Gleixner <> | Subject | Re: 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
| |