Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp123496pxr; Sun, 10 Apr 2022 09:09:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7KhZY1bNlV2Yq1SeoZRlGM5b3/DWI74TDoTT70mBRpT0T6CseQDFG5LrfhzaYFbSX82Ip X-Received: by 2002:a63:dc44:0:b0:381:5720:88a5 with SMTP id f4-20020a63dc44000000b00381572088a5mr23539384pgj.219.1649606980742; Sun, 10 Apr 2022 09:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649606980; cv=none; d=google.com; s=arc-20160816; b=Z2FjnctIa/o/lnQgDan+b0KXcFYoBxhxHG9pJ3dUFwjkVxgyIGDEIIDXjJ43q5U/Vr sQ/9n+3XEiiZCyMMmsuYKEJ3HEzY+QQS+GH+cR84Td0K6KOnQosLTt+/tYYXGoMePKuA beouQB4fy2n00l2rZPMV9tqdnWqXBjDRcOPmeS3SFuTqKAYwE630ZPWKp3FW4nMP5864 Rjk4Up01ulOnrjy00lPz42RUyRYoT42dyvUFWrgm9dQ6A8XmvIh4QH2dUxGYf4MVt9OW hgsDM/YyevtPmdqVdb8WPcQBHZbzqEDEbfxNfD+/vM77NDcILG6AdlfvGF6Rn3r6FwA7 L+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wdHWP0t2I4gTt2PnJNuvhJwBXPRJYjBIPAiVJ3HB0e0=; b=OVAgXF32hEo/3dGJpVHAOzKsxlNEq7Q4kVl/8LJpBBCviyKmAOmFhtwe9u9QsoWfLh JkJdYzxEK/VCyqJiR/l74k1W36keGtk27+WPwDKcF4Qqd7Dw8Ntrm7rXxJZ4GJnqEc1m KXJBSU7J7UirI86IkwCdsz5Gq/G8UHA1Py6+upNFmCjPoBPNGhz/G7Knm3eR9cFmj5xg edTYgYvZmzAOJklY7/BWCrfRi606yekDCCg1mKqqu4pW6C+Ab2FYrqGOonh78JBEdIA3 IrAdYqd7Hx17HBBI6oX8AlNJGFulkczn3jHbvsg06po3jQ5YOvGkIE5WGx+1d86SyT2b tSMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QtAta4Nf; 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 z17-20020aa78891000000b004ffa29aaa7dsi6634367pfe.261.2022.04.10.09.09.24; Sun, 10 Apr 2022 09:09:40 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QtAta4Nf; 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 S236348AbiDIBDR (ORCPT + 99 others); Fri, 8 Apr 2022 21:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbiDIBDP (ORCPT ); Fri, 8 Apr 2022 21:03:15 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0C523FF3D for ; Fri, 8 Apr 2022 18:01:06 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id c15so13459333ljr.9 for ; Fri, 08 Apr 2022 18:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wdHWP0t2I4gTt2PnJNuvhJwBXPRJYjBIPAiVJ3HB0e0=; b=QtAta4NfzmiaG3n/anjUkJNn/RBokeZn0QIZMmuCVSGsHCTZUWaxqGlO1P8T9+WL0k zTWPE9DViaYKncd3qngYwMM3R+8/o0SagjzQJ385e/ugtsauPumK4FH43ZUlpCAInf/4 n217oxniv5EAtBR7ErJqbWZE+J3gTSLW/PBa0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wdHWP0t2I4gTt2PnJNuvhJwBXPRJYjBIPAiVJ3HB0e0=; b=koBCM/svEzsI7hg57xjQjjmfNlWIr2kudrlFr9ZWf+7n2xrq2qvQ+Hf95WnEiolHgR eg35TtAyqmEdby1vilOObZ9MaWle+RQ0xrQktiMDrDwyPNUTQt5MZUsf3TxoLd+V62WV KKhHUVTiFKBXx/n0bEewqShWQoIqab83y7Q6bNTUrlBINbNCWN7QG6mreM4389BqOiV9 lt/4Kp+9t1aTFmeSlZ4duVfdM3aa+Iu7nCf+sOHmIuJckvnJgDd95RmUt5t4oHkqQkwM CqJNCp6dRjMrQXCsGbMHqHmNx8RTf94vlo0ZLtXwrvKnrwdZho+5lIRrS8rwRJBXYHI8 mvBA== X-Gm-Message-State: AOAM5330pRdf2FhHxlaDO3ZPn1ASY5YH2+/RAUWLXQw9QKlAyiT4gbmJ eDyumhlMv/oH1nOjKUtx5xg/lA7bKS+7EcWt X-Received: by 2002:a2e:b8c9:0:b0:249:90fc:71ba with SMTP id s9-20020a2eb8c9000000b0024990fc71bamr13267337ljp.466.1649466063892; Fri, 08 Apr 2022 18:01:03 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id e16-20020a196910000000b0044a13085dd5sm2596818lfc.270.2022.04.08.18.01.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 18:01:00 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id s17so5519638ljp.8 for ; Fri, 08 Apr 2022 18:01:00 -0700 (PDT) X-Received: by 2002:a05:651c:b07:b0:24b:4af9:828 with SMTP id b7-20020a05651c0b0700b0024b4af90828mr4951637ljr.506.1649466060069; Fri, 08 Apr 2022 18:01:00 -0700 (PDT) MIME-Version: 1.0 References: <20220407161745.7d6754b3@gandalf.local.home> <87pmlrkgi3.ffs@tglx> <87v8vjiaih.ffs@tglx> <20220408202230.0ea5388f@rorschach.local.home> <20220408204925.16361b44@rorschach.local.home> In-Reply-To: <20220408204925.16361b44@rorschach.local.home> From: Linus Torvalds Date: Fri, 8 Apr 2022 15:00:43 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] timers: Add del_time_free() to be called before freeing timers To: Steven Rostedt Cc: Thomas Gleixner , LKML , jstultz@google.com, Stephen Boyd , Andrew Morton , Peter Zijlstra , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Eric Dumazet , Guenter Roeck Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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, Apr 8, 2022 at 2:49 PM Steven Rostedt wrote: > > Hmm, well, I'm not sure it would work for all architectures, but what > about the MSB? Setting it to zero on "shutdown"? Let's just clear the whole thing for now. We don't actually _have_ any timer_restart() cases yet. I was more thinking that we might have situations where "I don't want to race with timers, but I also don't want to take an interrupt-safe lock" makes a lot of sense. Most people most definitely are just about "module unload" and similar issues, where it goes along with doing "task_work_cancel()" and friends. I do wonder if we want some way to shut down new timers that doesn't actually wait for old ones to finish. We've had issues with some code not being able to use del_timer_sync() simply because they hold locks that could deadlock with any "wait for running timer" situation. Those places couldn't use a synchronous cancel operation either, for the same reason. I'm not sure a "make sure no future timers can start" operation is sensible on its own, though. I can't think of a situation where that wouldn't also need that "wait for existing ones to finish". Linus