Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5803157rwb; Mon, 14 Nov 2022 09:38:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf77vYuls+1cvkpGEv/X/CQQdo0wu7kJ8Tk2liKVWdi/3L6uEXHdUTKhNNH6GnO2U6it2Wg7 X-Received: by 2002:a17:90b:3c41:b0:213:a153:4006 with SMTP id pm1-20020a17090b3c4100b00213a1534006mr14876362pjb.105.1668447487946; Mon, 14 Nov 2022 09:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668447487; cv=none; d=google.com; s=arc-20160816; b=tni1juGyp+pgh2k8OYWiad973shzf9fNAMuGiSCHnDa5kchCutxNxxC1NeiUbzyTAW JLCw99PlcWO8Zvfq0Wq1/0gEmWGN4eDEyPNxfq9jUPzNEcBUSN6DiiQ3P/7FTsuacdrt mlLlqfpsZQvLS/hgYUV2ksSbPs0SCCrO6m2WR9j21+x4mO+7ysMnCxdBZaxBUiH4eAum CosNEFOoO1oe7GcKsmAqrBLCv5yHTFZAfT1HOnzp6ts+ka5Fw0x5I/Y4gdRUOpwg8HYc 3PPBKi3jMOXGDBdqRrrtBLzQlSDGr0cycClQJg+EnEgyzEfXoL6YD7G8CESpRJwifGMM jAkg== 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=FwATKOMMweKsXI8MejrsmvPC+pLhLOMy4tm3g8Ji6So=; b=G8Ni4Zms+YbK9Xy+2n3wsHdF5j79EiTis6KDi1/bCxF/heAZ3MWEshzTIHnT+hLPRJ uI0cO5klcewj/B/2krnkdAPfsp2/cQNQQxU5YpD/DV5rFlV7YzfBOM9w21/mLOPeS21j SF3oqV0+59g7Zf4/D37NMfywBrFLX00L5/YRlivht3SOeS0QTUDGffp++EfHJ4K2bZdp 44apwpYA+Bz3BQc1/ySRQcWjNiJYym+vg/63+oS5MRUYc6eVUG2SffpDEGLSLAH4M3qi mLNZxcjYEch3KECeXkiJin/JL3YiFU6nkI7Q71egSh7PjSjJkg3B1Uo5KRvl8g5cfnfS LWig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=FzoH+MTW; 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 q9-20020a17090311c900b001853ad3944dsi10848951plh.480.2022.11.14.09.37.55; Mon, 14 Nov 2022 09:38:07 -0800 (PST) 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=FzoH+MTW; 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 S236963AbiKNRRG (ORCPT + 89 others); Mon, 14 Nov 2022 12:17:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237872AbiKNRQy (ORCPT ); Mon, 14 Nov 2022 12:16:54 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23A71A059 for ; Mon, 14 Nov 2022 09:16:52 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id e15so7191027qts.1 for ; Mon, 14 Nov 2022 09:16:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FwATKOMMweKsXI8MejrsmvPC+pLhLOMy4tm3g8Ji6So=; b=FzoH+MTWWCHj4vMKiE1IZSj92DU4GAfAJK3BMcYADwvwaCS2G1GuBQNEtiIoxSnuVI pfyH8k9d2+bDBZbngUzW44os7KZZRRa9Z+nWsHxPlZ17lnkvnIvArtw98wxMCJ5CwwCG TK7tsJANWARnNLhaxkO5LIHrybNJEfskiv/4Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FwATKOMMweKsXI8MejrsmvPC+pLhLOMy4tm3g8Ji6So=; b=lLBlEOabLHrPs8xn25WCIMMuXFVyUdoxq4p41hq27nL+zatmPpY0wLXCwGL/VuMbeX IhdWFgKJWZt+luRT+GDOGfsIRuDFHU6ap65/y2UOPUn3V1cfa82vHqedoSoxR8n3qdW0 5u+X7XNdl75jTcYgVHcZj22/mneIr+rRbLiaGdMXp8ZZqc3Txbf75PF5+rF0ukzaclSo 2F6dobWkgMZCoXh/cpLFbdNsrg1CUI7DRq1c3vsDDWKKsoSqMvbhlZ9UZjwV/xAavUOI 8TRalFHt1dFnGzD+nYxJbC3GEkGm+AZTmm+jlWiwLRFvdfzrFqai3kDi/JcATbjyShR4 8iog== X-Gm-Message-State: ANoB5plLmDnuoUiFxFQJeTwCzE5raUPOQAJ4PtNpkPNCpPteLCaIBHn4 pTHrL9AZWEofSKc9v1tJF8CRb1315YUUdw== X-Received: by 2002:a05:622a:302:b0:3a5:4f9b:215a with SMTP id q2-20020a05622a030200b003a54f9b215amr13410053qtw.394.1668446210918; Mon, 14 Nov 2022 09:16:50 -0800 (PST) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com. [209.85.222.170]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a29cb00b006ec62032d3dsm6928864qkp.30.2022.11.14.09.16.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Nov 2022 09:16:48 -0800 (PST) Received: by mail-qk1-f170.google.com with SMTP id z1so7816041qkl.9 for ; Mon, 14 Nov 2022 09:16:47 -0800 (PST) X-Received: by 2002:a37:46d6:0:b0:6ee:24d5:b8fc with SMTP id t205-20020a3746d6000000b006ee24d5b8fcmr12144736qka.336.1668446207273; Mon, 14 Nov 2022 09:16:47 -0800 (PST) MIME-Version: 1.0 References: <20221110064101.429013735@goodmis.org> <20221110064147.343514404@goodmis.org> <875yfitpdu.ffs@tglx> <20221113191518.0a3b29b1@rorschach.local.home> <87sfims7ca.ffs@tglx> <87iljhsftt.ffs@tglx> In-Reply-To: <87iljhsftt.ffs@tglx> From: Linus Torvalds Date: Mon, 14 Nov 2022 09:16:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 4/6] timers: Add timer_shutdown_sync() to be called before freeing timers To: Thomas Gleixner Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Julia Lawall , Eric Dumazet , Marcel Holtmann 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 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 Mon, Nov 14, 2022 at 7:42 AM Thomas Gleixner wrote: > > So if we want to make this solid and make the life of driver writers > easier, then we cannot issue a warning as I said in the original thread > already. So I think that there are two issues at play: (a) do we want to *find* problem places after the conversion (b) do we want to make driver writing easier and (a) argues for warning on timer re-arming, but (b) just says "don't warn, just ignore it, the driver is being shut down". I'm personally ok with either of those approaches, and it's literally just a question of mindset. > The semantics of timer_shutdown_sync() have to be: > > After return: > - the timer is not queued > - the timer callbacks is not running > - the timer cannot be enqueued again Yes, but that last case is literally a "do we expect the *driver* to not enqueue it and warn if it tries, or do we just silently enforce it"? I agree with all three points. I'm just not sure about who we expect to do the "don't enqueue again". There's a big argument for "make it easy for driver writers" in just saying "make mod_timer() silently just ignore a re-arming". Making things easier for driver writers is a good thing. But maybe it's a "you shouldn't have done that in the first place" thing, and merits a warning? I have no strong opinions on that. What I *do* still want to happen is for subsystems to be able to start doing the conversion one by one. Which is why I'd still prefer to have the new names available just so that we don't have to have one 50-patch series, but we can have subsystems apply the obvious cases. And I'd still like the mindless "let's get the non-semantic changes out of the way" as one single patch, to get rid of mindless noise. And honestly, for that to happen I'd be perfectly happy with something like #define timer_shutdown(t) del_timer(t) #define timer_shutdown_sync(t) del_timer_sync(t) (obviously with the patches that first remove the existing 'timer_shutdown()' uses first). That wouldn't introduce the *new* semantics, but it would at least allow the different subsystems to do the obvious cases, and let the networking people wonder about the much less obvious ones. Linus