From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.155 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794663511; b=V7D2okcNlE9GLoNda8BByPGPgi8QNA56L23w6sPjPZ72MdiFoILeRBWp3TIeGlCJ+vQk G1soYBDiMdjBt0660F+TP3Y9kLlk2mTNrDqSq1KdIELfi8n99VT7gCkwfE0h7MV/Dzx4a 5fRaDUVTTJG7GHuylr+phKJ6rbsBdbOMVy13JFufu2rscoDes/M2WCGn/tujRIasLCgba ac4hwwdFyTELZDincyrLABPIZe0m5vHif1LRqBn/7r6Aob4yURYcWQtfXtAMgacDMO3PB +qHzgoB8ZucRi+O4fs1rAvV2ua1Bt5ZwMLc25okaLobqeHTW3Tb20mNQt6hxbB5dsIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794663511; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Date:Message-Id:To:Cc:Subject:From:In-Reply-To:References: Mime-Version:Content-Type:Content-Transfer-Encoding; bh=SNG1HRb8nHFIie74LXwMhLAKLST7T7jquSoOJxOlEK0=; b=VL1+uu019UR/5uBvcgR8/vH8Lo/0JeyrfYmv4T7V4NHa4MkINBfn5++D89O+kEMRCb9p iNCNmOfOK1UhiKHQ39UfyA87wdcGr/WwN5r0Yhq7FudEkXtZz5HUgjx7Jrb2I4ZlcTDB8 O6Ha5XumBap1NjdCiZ1SwUGGCxPOZlSJItcarUXeZ7VLGl5SumOwLKXnBTRq7eF8IP+Qw 3Y0dTg1q8K+zFu8+b7XTp29NbuhocN/CQ371rgDTVUVY58h4V7vYMqGnt0mjm+7h7AGAD gxtVURXiOl8MyW8CZclHPGXtTPMsrOIVmf2Op3e3zJ7VDmcnThqMV2VGIys8i2MxwPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=flapping.org; spf=pass smtp.mailfrom=flapping.org; dkim=pass header.d=flapping.org header.i=@flapping.org header.a=rsa-sha256 header.s=fm2 header.b=kjDDMOtI; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=ZXkXzX04; arc=none smtp.remote-ip=103.168.172.155 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B5D7606A327 for ; Sat, 14 Nov 2026 13:38:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5B5D7606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=flapping.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flapping.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=flapping.org header.i=@flapping.org header.a=rsa-sha256 header.s=fm2 header.b=kjDDMOtI; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=ZXkXzX04 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 6A75914000A7 for ; Sat, 14 Nov 2026 08:38:25 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Sat, 14 Nov 2026 08:38:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flapping.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1794663505; x=1794749905; bh=SNG1HRb8nHFIie74LXwMhLAKLST7T7jquSoOJxOlEK0=; b= kjDDMOtIsUw7bSdWWMIMxExjuwJMfM6fUrRhZ/kFv1JsJBLXywr9mHhX+SQDzzKL rKTLGR37Le4FAOmgLPO0KiDyAVR3YCYNb0KVZG5JNRvkJIO4s6Kdh5y5z4gvHxuD YoBd6lFVs/24bKmI9bnee/fjcTf4jdUZ+ubQCVjr9Lk3RlKwIswN7V5hHEdKM3Ws KUZXeEUA5otuYK85n6SwzwHm9Z+/QFhWWw5YLxnlJRvuW+b680eNQbJhAtk/X0ru K/d/r1qWZ7kseS+YbngpiXfIL7iYYXQccr7Cq6Cs+vYUOXmgSmNDVZtljBk7/6WN t0VXWL1hN7FszJUBrep20Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1794663505; x= 1794749905; bh=SNG1HRb8nHFIie74LXwMhLAKLST7T7jquSoOJxOlEK0=; b=Z XkXzX04q4UyVz+lf8NtnAgfAHirWryfPU5tFvaA69SsZe0EW7fjK87bBsFggvRpW J2f+3lARbnoLTkqwtl35LjIb0iUpLtmCwrnrBYEikvU0Jwcgavp8aFLkSnylEuam lV5ex/fR1r5uzupd6qCJaJOQKGlfAXcZQXmQ5YSydfcL2DTX5HHcIHvHF76i+7aQ fhxuq5ksXHxYucjDpTQRgYVe6LfDuMiBo8HKNPI8zj7pJ6XxBOd/QJSq9udXruZs KTXMSrxV3OuCOJs0AyyWvDGaSvumSOXPhBONC3zy39O6Eg2ZZR6AcwKFGeD9EMuO BhlEvcRK48YyymFm4jqjw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=flapping.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1794663505; d=flapping.org; mf=PHRvbW9AZmxhcHBpbmcub3JnPg==; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm2:rsa-sha256:aIVU6BRpEb2R8GY654+bbUZBP5PkgtGV7YU3tM8ZhhYQwcW dmYIseLJeuvaP128K1pqiyNivNeRocdLs/k2mWbiQC8nKTbdDMsYT37Vm70QeTLA VP+2Uskzp+GEDkh898ysjghuhH3Cx8gr9VG6t5SnxA3A85SJ9Q7qdM3GKyIvipsw PMRRm7EE2AjekrWJyxuPJZfs/0SZnudFSwsmUzSN3AGbO0bjJeXtRR4ehyXBQXy9 fcVW0tR2O0iKj7/CqmOelVnMY1sVdZ0ZO4JUL9XPdMTA0E9ebZhKzD/+EatEGoP5 /5DA/B317azSCXTT0s9EglxL8ldYRvGmHtBMinQ==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:f9opZpIyqagmduFeeGp+xKUJT++WTJdd2E/jjBkBYfo=:lU5PHoFLOrW5W3SGXZtCpCZosecH1DWsdh966u97RCw=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGP3BUWlQUihCukVcPKcTSgRT44A4NtkjyCSrpXOA/rwXWHPdz16CsJwJJyEfGatL lN7ru0/bjWuVwus+qg8IqcETdlNBpF48fef4z6tyHamWyDNIIzYe03ACQowYrwSJHAZ8Vo lvfypnf3SveEnc3NnZR4xRbeVLvsA/FkY75IBy+dYZd6B7umcwKRfgMYFd/WK5QM57Vnj9 BmeVgMpoO/QOvVLovaVWsh8nVgQuZu4003ZqUiazRIRGRLF3S70i9QhkTtXD9RzX7Czkmn MgWG+ZxTViB8Xw02wyuvpZ45gFna4jOQNaOt1JFnvKw+0f8ie4mpP7NZIWqxFpdmlz1kKe y6mh+4B83bYFIJ0yFcWsfd1rFn5SmSEnudjOYZK7gYqCCwbMuhnMpexVFxv9ob9ECe4I67 by5e77wcZfvni8QYKNOaKXwrl2jxeEbJOIR1pNN3PB3KVKRXCoOmlm6V6Me+St6KWuc06J xPt1KCwstHXAvPslZk0UMcWTc9ubQcq8uJAYSywQHe0VwHvctj4Vdl7z4KQdJ9uM/25bhJ XXQCdN1KprZ+6AE5H2qB0zIpkeCXi829c66eEWFkab/pH680qxI+BuVSZxBUl6vkFZ10Fy llHgiwxI+0uxLOI67X1HIa+ljQs19jVFyJOuUYlCGKfjNDFicbB4MA7kV9vg X-ME-Proxy: Feedback-ID: i51fe4b43:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Nov 2026 08:38:19 -0500 (EST) Date: Sat, 14 Nov 2026 22:38:16 +0900 (JST) Message-Id: <20261114.223816.1091200428221776094.tomo@flapping.org> To: a.hindborg@kernel.org Cc: tomo@flapping.org, boqun@kernel.org, fujita.tomonori@gmail.com, frederic@kernel.org, lyude@redhat.com, tglx@kernel.org, anna-maria@linutronix.de, jstultz@google.com, sboyd@kernel.org, ojeda@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, daniel.almeida@collabora.com, tamird@kernel.org, acourbot@nvidia.com, work@onurozkan.dev, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] rust: hrtimer: add active() method to query timer state From: FUJITA Tomonori In-Reply-To: <87wlqiv386.fsf@t14s.mail-host-address-is-not-set> References: <20261105-hrtimer-active-v3-1-52636808ccda@kernel.org> <20261105.201145.828445900027892304.tomo@flapping.org> <87wlqiv386.fsf@t14s.mail-host-address-is-not-set> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Thu, 12 Nov 2026 09:55:05 +0100 Andreas Hindborg wrote: > FUJITA Tomonori writes: > >>> + /// Query the state of the timer. >>> + /// >>> + /// Returns [`true`] if the timer is in the started or running states. >>> + /// >>> + /// This method synchronizes internally and does not require exclusive access to the timer. >>> + /// >>> + /// The returned value is a snapshot. A concurrent start or expiry can change the state of the >>> + /// timer right after this method returns, so callers that need the state to be stable must >>> + /// serialize against those operations by other means. >> >> Does "expiry" here mean that the callback returns HrTimerRestart::NoRestart >> on another CPU? An expiry alone moves the timer from started to running, so >> active() still returns true. If so, I think it is clearer to write this case >> directly, and to add the case where the timer is canceled on another CPU. >> >> The same sentence is in the commit message, so please update it too. > > Right. How about this: > > The returned value is a snapshot. A concurrent evnet can change the state of the > timer right after this method returns, so callers that need the state to be stable must > serialize against those operations by other means. > > The intention is not to reiterate the state machine, but to indicate > that things might changes. Looks good to me, except for one small point. Since "start or expiry" was removed, it's not clear what "those operations" refers to. How about something like: must serialize against such events by other means. Also typo: evnet -> event