Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5979632rwb; Tue, 22 Nov 2022 07:20:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7qvCMkFyvYZtMNGu/bETolV9Na3l6vJqlpfnFxKs928G4mlJtneaIjpih/DJp6NSIS/wBo X-Received: by 2002:a17:906:1e4a:b0:78d:3505:6f3e with SMTP id i10-20020a1709061e4a00b0078d35056f3emr19760832ejj.611.1669130425625; Tue, 22 Nov 2022 07:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669130425; cv=none; d=google.com; s=arc-20160816; b=KAjCDjIfPeNEwn2stp54dsIQ0Vcgxq8GD1nMgbotCJCLB1FA6ZRj+LIpG0u7EKpcis is3p2thSwW44rPn/R951cA6+w9g4TC7hPEJHjg3P1Dxt9MtZ4QkRX0a7L2Yorg9d+Jvn zet/0xdsZRk7VDaeV4Cz/CvJROfe0i68iCxqnoPMQcYHkLPS6dECXEp2IdwBPM3ksgw0 eEm8LG6nlvW0pscwdB7TI+T0VQrCYpu9Ce5wkVMiQYd9hDcueZji3w4kZzmAUXC+fkqA ytZ8aQ8Y/051ekBoVde/65P4cwPG4dIUNFjr5FzuEXiZVU6hMkN3uPyhbRUolGEQrNKV O5kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=zKbYB4/x4Eioa7NTJUmecxu616udhot1tUi1AdzIwgg=; b=iKYMmy7Y2M39N5Mx6eIGwx7pjhshg94BFvDrki4tFOnYVtjtqHJn9Al0fJI4djMOQT OAgpyefXo4nTDQdTM5AweMzPF4zcjCJasf3G7pw9jK2mNX5N7j+4XGiM50whkKtz24vp dKaLb/mme2NV78Lxs09mHQExfclRzCZZ0C001CSvRN2XsvZOM2a16+YgIoXHUXGWdDMU xMTRWCbinyMZKKWQ1IZCZ6FjkaC8xLPpq+WLdrkc7cFDU8nXNX1EMr1GHWGDJycAQ+uV 1AzDMi5X1n5HVBa1oa74AW51iPkBfTc2d7905Y+dfm+7CxGFtdozGzutpxSpm5h1Hcvj 6AEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ey2IoXaw; dkim=neutral (no key) header.i=@linutronix.de header.b=ICE1QM57; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw7-20020a170906478700b007806964b2fcsi7911115ejc.447.2022.11.22.07.19.45; Tue, 22 Nov 2022 07:20:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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=@linutronix.de header.s=2020 header.b=Ey2IoXaw; dkim=neutral (no key) header.i=@linutronix.de header.b=ICE1QM57; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbiKVPSq (ORCPT + 99 others); Tue, 22 Nov 2022 10:18:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbiKVPSl (ORCPT ); Tue, 22 Nov 2022 10:18:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DEFC697EF; Tue, 22 Nov 2022 07:18:40 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669130318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zKbYB4/x4Eioa7NTJUmecxu616udhot1tUi1AdzIwgg=; b=Ey2IoXawMVtLO5Oz/+AojWtt7Y1O6buWlGKuq2VPYazDeXZbmqwmiwCVUWLojKqA8lddS3 Vom/NA5oRvZCJhKAvZFTtk7bnke16rUjp4gkbgj1yljYcFgAkgnF5w6gQCmL+YKAm6Mrci Ev09bKcwBCLrD85tFVZfLqCteK++Ydlp/jSNEcK3zLhnQvEiaYozZYkm+O9pz5RrszB/Q6 3j9meXZS5KnAd24TvtZcNlDXtsPbobEsmxVGHwnv/UeG/jstji3fqbxhQQQDfwCx1p0nrl J2esgdPB/9O7su2vHr4T5nG9p8wXd6uEuVk1YwnxyH55SwcBMMNwFZwQUZsp/w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669130318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zKbYB4/x4Eioa7NTJUmecxu616udhot1tUi1AdzIwgg=; b=ICE1QM57jId/IFgN6qEk+MfqfeLm8OOmL9ViEHwpjhMU2eO4RrRFphenE7lb1cEJa8mvTG Ln7mObid0wx01WDw== To: Steven Rostedt Cc: LKML , Linus Torvalds , Anna-Maria Behnsen , Peter Zijlstra , Stephen Boyd , Guenter Roeck , Andrew Morton , Julia Lawall , Arnd Bergmann , Viresh Kumar , Marc Zyngier , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Jonathan Corbet Subject: Re: [patch 06/15] timers: Update kernel-doc for various functions In-Reply-To: <20221121154358.36856ca6@gandalf.local.home> References: <20221115195802.415956561@linutronix.de> <20221115202117.323694948@linutronix.de> <20221121154358.36856ca6@gandalf.local.home> Date: Tue, 22 Nov 2022 16:18:37 +0100 Message-ID: <878rk3ggqa.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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-bluetooth@vger.kernel.org On Mon, Nov 21 2022 at 15:43, Steven Rostedt wrote: > On Tue, 15 Nov 2022 21:28:43 +0100 (CET) > Thomas Gleixner wrote: >> EXPORT_SYMBOL(mod_timer_pending); >> >> /** >> - * mod_timer - modify a timer's timeout >> - * @timer: the timer to be modified >> - * @expires: new timeout in jiffies >> + * mod_timer - Modify a timer's timeout >> + * @timer: The timer to be modified >> + * @expires: New timeout in jiffies >> * >> * mod_timer() is a more efficient way to update the expire field of an > > BTW, one can ask, "more efficient" than what? > > If you are updating this, perhaps swap it around a little. > > * mod_timer(timer, expires) is equivalent to: > * > * del_timer(timer); timer->expires = expires; add_timer(timer); > * > * mod_timer() is a more efficient way to update the expire field of an > * active timer (if the timer is inactive it will be activated) > * > > As seeing the equivalent first and then seeing "more efficient" makes a bit > more sense. Point taken. >> * >> - * The timer's ->expires, ->function fields must be set prior calling this >> - * function. >> + * The @timer->expires and @timer->function fields must be set prior >> + * calling this function. > > "set prior to calling this function" Fixed. >> * >> - * The function returns whether it has deactivated a pending timer or not. >> - * (ie. del_timer() of an inactive timer returns 0, del_timer() of an >> - * active timer returns 1.) >> + * Contrary to del_timer_sync() this function does not wait for an >> + * eventually running timer callback on a different CPU and it neither > > I'm a little confused with the "eventually running timer". Does that simply > mean one that is about to run next (that is, it doesn't handle race > conditions and the timer is in the process of starting), but will still > deactivate one that has not been started and the timer code for that CPU > hasn't triggered yet? Let me try again. The function only deactivates a pending timer, but contrary to del_timer_sync() it does not take into account whether the timers callback function is concurrently executed on a different CPU or not. Does that make more sense? >> + * prevents rearming of the timer. If @timer can be rearmed concurrently >> + * then the return value of this function is meaningless. >> + * >> + * Return: >> + * * %0 - The timer was not pending >> + * * %1 - The timer was pending and deactivated >> */ >> int del_timer(struct timer_list *timer) >> { >> @@ -1270,10 +1284,16 @@ EXPORT_SYMBOL(del_timer); >> >> /** >> * try_to_del_timer_sync - Try to deactivate a timer >> - * @timer: timer to delete >> + * @timer: Timer to deactivate >> * >> - * This function tries to deactivate a timer. Upon successful (ret >= 0) >> - * exit the timer is not queued and the handler is not running on any CPU. >> + * This function cannot guarantee that the timer cannot be rearmed right >> + * after dropping the base lock. That needs to be prevented by the calling >> + * code if necessary. > > > Hmm, you seemed to have deleted the description of what the function does > and replaced it with only what it cannot do. Ooops.