Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933320AbZLGKfs (ORCPT ); Mon, 7 Dec 2009 05:35:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752584AbZLGKfq (ORCPT ); Mon, 7 Dec 2009 05:35:46 -0500 Received: from www.tglx.de ([62.245.132.106]:59626 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572AbZLGKfp (ORCPT ); Mon, 7 Dec 2009 05:35:45 -0500 Date: Mon, 7 Dec 2009 11:35:31 +0100 (CET) From: Thomas Gleixner To: "Nikita V. Youshchenko" cc: LKML , Peter Zijlstra Subject: Re: When it is save to kfree() hrtimer object? In-Reply-To: <200912071045.09827@blacky.localdomain> Message-ID: References: <200912071045.09827@blacky.localdomain> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 27 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/