From nobody Thu Apr 9 03:29:47 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC28532AAB2; Wed, 11 Mar 2026 09:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773221494; cv=none; b=Zmjt+9/ZOKT2mRZBDhZ/HtG9STeKh2fqKcGGvbF7DCLEYs3kqcVAenehmuwmXeSG54WemjPUkA38c5dUBy5NcQgoMmjfIkxOOOOzV1Ko6foGCtMhEX2dJu7z9QOQ54Jip5BZQVGkDQ6oan5Aoy8zsZXSzMBf2ZMGMcWZf2qGnfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773221494; c=relaxed/simple; bh=fJt3wH8TT/ORVtu73RTfdOs5X5rcoBLjnZ2lY6rv2Fo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=RSyoKbH1iJdhzfb9R8pfH7L1nAnbYgrDB7Md0yhWlFJejMgghN7nT4oxf/Uh3f37DYB11Io4IXSoEgRqq3O4W5WPso9JTX/t+8HIfTxjSNbb4JGQrUTjdSDNPxMREg2k20tG2iit59VKrnT/aPBLqt2fRnnNNdXwAOCQnk5nrV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UcW24vXy; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CjH18jCj; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UcW24vXy"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CjH18jCj" Date: Wed, 11 Mar 2026 09:31:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773221491; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tIVy5TywslsEeoXC2wMpwn3HviNbC/NszQKMJ/X2YW8=; b=UcW24vXyTA9vD86mzKZxZ4HidTTukdLNIngr6ha26+6X3RxQAIlgrjdCEw4XmreJNZ+8C6 NzqzQBd+1QM36QPsmAR2Cwk2jkg5nlH3RUzjZxea4vzw7EQN9LLmj4FrKCteKF6d5VN6Du uw4mCJh6LY9l+0t77Gu83+OV224llmA/cAFCUh2UylxysA5Tb83UtTKv2yi/RsmtX+trj8 hb7lr97+Dzj4n+c24wm5tynK7cx1q8yr5MO2VcsWOKe8ge9eqd7s3wvX2KGgJJtNqsEKZ/ bQnCWhcwKWSLjtCUNuMEtju3S8cfHLWuYTY0BSVle9Q80XPnLC3t0ValSo8Z9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773221491; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tIVy5TywslsEeoXC2wMpwn3HviNbC/NszQKMJ/X2YW8=; b=CjH18jCjWOZW8p+U4MwS8kFa9l+v8B6ZNm0t7Pznk4eIZZ2PGiLD0RTheWJXPZsI7FohFT oO3yfSLzVbTz8bDQ== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/vdso] vdso/gettimeofday: Move the unlikely() into vdso_read_retry() Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260227-vdso-cleanups-v1-4-c848b4bc4850@linutronix.de> References: <20260227-vdso-cleanups-v1-4-c848b4bc4850@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177322148987.1647592.16441716455388205532.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/vdso branch of tip: Commit-ID: 76970d39a0600e7432b4e4fb538ba0a81e8b4add Gitweb: https://git.kernel.org/tip/76970d39a0600e7432b4e4fb538ba0a81= e8b4add Author: Thomas Wei=C3=9Fschuh AuthorDate: Fri, 27 Feb 2026 07:43:23 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 11 Mar 2026 10:27:35 +01:00 vdso/gettimeofday: Move the unlikely() into vdso_read_retry() All callers of vdso_read_retry() test its return value with unlikely(). Move the unlikely into the helper to make the code easier to read. This is equivalent to the retry function of non-vDSO seqlocks. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260227-vdso-cleanups-v1-4-c848b4bc4850@lin= utronix.de --- include/vdso/helpers.h | 2 +- lib/vdso/gettimeofday.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/vdso/helpers.h b/include/vdso/helpers.h index a776554..403bb45 100644 --- a/include/vdso/helpers.h +++ b/include/vdso/helpers.h @@ -52,7 +52,7 @@ static __always_inline u32 vdso_read_retry(const struct v= dso_clock *vc, =20 smp_rmb(); seq =3D READ_ONCE(vc->seq); - return seq !=3D start; + return unlikely(seq !=3D start); } =20 static __always_inline void vdso_write_seq_begin(struct vdso_clock *vc) diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 2faed78..efd1b82 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -135,7 +135,7 @@ bool do_hres_timens(const struct vdso_time_data *vdns, = const struct vdso_clock * =20 if (!vdso_get_timestamp(vd, vc, clk, &sec, &ns)) return false; - } while (unlikely(vdso_read_retry(vc, seq))); + } while (vdso_read_retry(vc, seq)); =20 /* Add the namespace offset */ sec +=3D offs->sec; @@ -163,7 +163,7 @@ bool do_hres(const struct vdso_time_data *vd, const str= uct vdso_clock *vc, =20 if (!vdso_get_timestamp(vd, vc, clk, &sec, &ns)) return false; - } while (unlikely(vdso_read_retry(vc, seq))); + } while (vdso_read_retry(vc, seq)); =20 vdso_set_timespec(ts, sec, ns); =20 @@ -188,7 +188,7 @@ bool do_coarse_timens(const struct vdso_time_data *vdns= , const struct vdso_clock seq =3D vdso_read_begin(vc); sec =3D vdso_ts->sec; nsec =3D vdso_ts->nsec; - } while (unlikely(vdso_read_retry(vc, seq))); + } while (vdso_read_retry(vc, seq)); =20 /* Add the namespace offset */ sec +=3D offs->sec; @@ -212,7 +212,7 @@ bool do_coarse(const struct vdso_time_data *vd, const s= truct vdso_clock *vc, =20 ts->tv_sec =3D vdso_ts->sec; ts->tv_nsec =3D vdso_ts->nsec; - } while (unlikely(vdso_read_retry(vc, seq))); + } while (vdso_read_retry(vc, seq)); =20 return true; } @@ -244,7 +244,7 @@ bool do_aux(const struct vdso_time_data *vd, clockid_t = clock, struct __kernel_ti =20 if (!vdso_get_timestamp(vd, vc, VDSO_BASE_AUX, &sec, &ns)) return false; - } while (unlikely(vdso_read_retry(vc, seq))); + } while (vdso_read_retry(vc, seq)); =20 vdso_set_timespec(ts, sec, ns); =20