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 6959FC38A02 for ; Fri, 28 Oct 2022 20:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiJ1Ut2 (ORCPT ); Fri, 28 Oct 2022 16:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbiJ1UtK (ORCPT ); Fri, 28 Oct 2022 16:49:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AAB0248C95; Fri, 28 Oct 2022 13:48:55 -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 8F2FF62A65; Fri, 28 Oct 2022 20:48:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07F03C433D6; Fri, 28 Oct 2022 20:48:53 +0000 (UTC) Date: Fri, 28 Oct 2022 16:49:10 -0400 From: Steven Rostedt To: Trond Myklebust Cc: "linux-kernel@vger.kernel.org" , Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna Schumaker , "linux-nfs@vger.kernel.org" Subject: Re: [RFC][PATCH v2 00/31] timers: Use del_timer_shutdown() before freeing timers Message-ID: <20221028164910.6804a855@gandalf.local.home> In-Reply-To: References: <20221027150525.753064657@goodmis.org> <20221028145005.28bc324d@gandalf.local.home> 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, 28 Oct 2022 20:12:30 +0000 Trond Myklebust wrote: > I seem to vaguely remember that at the time, del_timer_sync() would loop > in order to catch re-arming timers, whereas del_singleshot_timer_sync() > would not, hence the commit message. The expectation for > del_singleshot_timer_sync() was simply that the caller would ensure > safety against re-arming, which was indeed the case for this code. Well, that expectation didn't last long. Your commit was added on June 22, 2005. Then on June 23, 2005 (the next day!) this happened: 55c888d6d09a0 ("timers fixes/improvements") Which has: @@ -89,12 +77,12 @@ static inline void add_timer(struct timer_list * timer) #ifdef CONFIG_SMP extern int del_timer_sync(struct timer_list *timer); - extern int del_singleshot_timer_sync(struct timer_list *timer); #else # define del_timer_sync(t) del_timer(t) -# define del_singleshot_timer_sync(t) del_timer(t) #endif +#define del_singleshot_timer_sync(t) del_timer_sync(t) + So much or efficiency! :-) I guess converting it back to del_timer_sync() is the right thing to do regardless of this patch series. I'll send you a patch. -- Steve