Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp411009pxb; Tue, 12 Apr 2022 04:56:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiZ6T6pWnaGVmB6FoH0l4bHXqZlX6ll3AjWVh5UrDwIFyQ3v+gYxOLS/yNCbjP3Q07DaXo X-Received: by 2002:aa7:9019:0:b0:4fa:7532:9551 with SMTP id m25-20020aa79019000000b004fa75329551mr37888177pfo.26.1649764610871; Tue, 12 Apr 2022 04:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649764610; cv=none; d=google.com; s=arc-20160816; b=HUaYiomVUCkx5+hnACZQ5ACaVQk0Ai1guFSPifWwhEJs/NdnW/xng1gQdPSq+JAzTJ 9/bkGuqLdXsLfZtm4VOAScTz+TrAZC7059OhqiE+srtkGT/ggJ65x6Z+DAtFBnlwUNY9 vE52uHlB0AYrRXNytHvGdA1RwNipas9jZFcOXRVaDEvQX/z4iHYriYX0rCd+4lLE0Kur aPl+0Fe/GYq4dGz/M10I7vXdRM/zLenG3eym9w3g9VeCbRyvQdjQd/5LZWNQ+6PI/BBc 5Tw5qe9Uv0rsyjCLCGfPojdrTUzv15wb9q88PbAXi65vWu6t2K4jDerP443pXAro/a/R i4eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=wLsIknNfwkVyvrA4XCzq3o/3+nDWm+RgYkQP+BU8ato=; b=shB7N6P3GjuQDTKn5tR181tLPL6RUnOCj3VBe1aPZC/65vE+oSxWdbCVWqOUWvGHId ZVc5MvSRVeqMA3Rpa5h2/h54oNxDVMXOR3EEdsqG+6u9O0H+25u1KFDKICykyUNh0KE9 m4b92OYmAQ7raqGeNEgecqecfz2vi5/cBBdS+kzN61Sr2xnhWUsIxxifmmPxVGyazJXK 1giWrx5GAU0VXPmvZdhW+RrAyDtK5mSDWBnbPxAPWl6MVFp1uvjHSVSUahKpXUesGQaS vXj9bANv+cmg6iZwkbHwZREQfQbMGd+f3WQowxoL4MOcAkboE2a+RJw0rhMNw+sFC6TU WjoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a631945000000b003816043f056si2342314pgz.587.2022.04.12.04.56.37; Tue, 12 Apr 2022 04:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237941AbiDHP56 (ORCPT + 99 others); Fri, 8 Apr 2022 11:57:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237930AbiDHP5n (ORCPT ); Fri, 8 Apr 2022 11:57:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B8AF6416 for ; Fri, 8 Apr 2022 08:55:37 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4413FB82BCB for ; Fri, 8 Apr 2022 15:55:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E45FC385A6; Fri, 8 Apr 2022 15:55:32 +0000 (UTC) Date: Fri, 8 Apr 2022 11:55:30 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , jstultz@google.com, Stephen Boyd , Linus Torvalds , 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: <20220408115530.0ccdf2e8@gandalf.local.home> In-Reply-To: <87pmlrkgi3.ffs@tglx> References: <20220407161745.7d6754b3@gandalf.local.home> <87pmlrkgi3.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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 08 Apr 2022 12:37:40 +0200 Thomas Gleixner wrote: > +++ b/include/linux/timer.h > @@ -183,12 +183,17 @@ extern int timer_reduce(struct timer_lis > extern void add_timer(struct timer_list *timer); > > extern int try_to_del_timer_sync(struct timer_list *timer); > +extern int __del_timer_sync(struct timer_list *timer, bool free); Do we really want to expose this to all the kernel? That is, we do not need to make the static inlines in the header, but instead do the split in the timer.c file. Not to mention, why have the "free" parameter be created by the callers? It duplicates the work of updating the second parameter around the kernel, instead of just in one place. One concern I have is that I wanted to keep the "free" version right next to the del_timer() prototype. That way it becomes more visible to users and they will be more likely to see it. I'm wondering if some of the issue with not using del_timer_sync() is because it is not next to the other prototypes, and people may have missed it. > > -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) Is the above not important for del_timer_sync() anymore? Can we just have a del_timer_sync() prototype and not have this macro logic anymore? Anyway, I'll take this code and make my updates and send out a v2. Thanks, -- Steve > - extern int del_timer_sync(struct timer_list *timer); > -#else > -# define del_timer_sync(t) del_timer(t) > -#endif > +static inline int del_timer_sync(struct timer_list *timer) > +{ > + return __del_timer_sync(timer, false); > +} > + > +static inline int del_timer_sync_free(struct timer_list *timer) > +{ > + return __del_timer_sync(timer, true); > +} > > #define del_singleshot_timer_sync(t) del_timer_sync(t)