From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91291C433EF for ; Sat, 9 Apr 2022 00:22:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239806AbiDIAYm (ORCPT ); Fri, 8 Apr 2022 20:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbiDIAYj (ORCPT ); Fri, 8 Apr 2022 20:24:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062A9DFDC9 for ; Fri, 8 Apr 2022 17:22:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 987B062199 for ; Sat, 9 Apr 2022 00:22:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07F18C385A1; Sat, 9 Apr 2022 00:22:31 +0000 (UTC) Date: Fri, 8 Apr 2022 20:22:30 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Linus Torvalds , LKML , jstultz@google.com, Stephen Boyd , Andrew Morton , Peter Zijlstra , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Eric Dumazet , Guenter Roeck Subject: Re: [RFC][PATCH] timers: Add del_time_free() to be called before freeing timers Message-ID: <20220408202230.0ea5388f@rorschach.local.home> In-Reply-To: <87v8vjiaih.ffs@tglx> References: <20220407161745.7d6754b3@gandalf.local.home> <87pmlrkgi3.ffs@tglx> <87v8vjiaih.ffs@tglx> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 08 Apr 2022 22:29:58 +0200 Thomas Gleixner wrote: > Well, you'd have to reinitialize it first before the explicit rearm > because the shutdown cleared the function pointer or if we use a flag > then the flag would prevent arming it again. We could always use the LSB bit of the function as a "shutdown" flag, where: timer_shutdown() { [..] timer->fn = (void *)((unsigned long)timer->fn | 1); [..] } timer_rearm() { [..] timer->fn = (void *)((unsigned long)timer->fn & ~1UL); [..] } mod_timer() { if ((unsigned long)timer->fn & 1) return -EBUSY?; [..] } -- Steve