From: "tip-bot2 for Thomas Weißschuh" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: thomas.weissschuh@linutronix.de,
Thomas Gleixner <tglx@linutronix.de>, Jan Kara <jack@suse.cz>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/futex] futex: Store time as ktime_t in restart block
Date: Fri, 14 Nov 2025 15:33:14 -0000 [thread overview]
Message-ID: <176313439408.498.1645769750771932244.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20251110-restart-block-expiration-v1-2-5d39cc93df4f@linutronix.de>
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: c42ba5a87bdccbca11403b7ca8bad1a57b833732
Gitweb: https://git.kernel.org/tip/c42ba5a87bdccbca11403b7ca8bad1a57b833732
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Mon, 10 Nov 2025 10:38:52 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 14 Nov 2025 16:29:53 +01:00
futex: Store time as ktime_t in restart block
The futex core uses ktime_t to represent times, use that also for the
restart block.
This allows the simplification of the accessors.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20251110-restart-block-expiration-v1-2-5d39cc93df4f@linutronix.de
---
include/linux/restart_block.h | 2 +-
kernel/futex/waitwake.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h
index 7e50bbc..4f9316e 100644
--- a/include/linux/restart_block.h
+++ b/include/linux/restart_block.h
@@ -32,7 +32,7 @@ struct restart_block {
u32 val;
u32 flags;
u32 bitset;
- u64 time;
+ ktime_t time;
u32 __user *uaddr2;
} futex;
/* For nanosleep */
diff --git a/kernel/futex/waitwake.c b/kernel/futex/waitwake.c
index e2bbe55..1c2dd03 100644
--- a/kernel/futex/waitwake.c
+++ b/kernel/futex/waitwake.c
@@ -738,12 +738,11 @@ int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time
static long futex_wait_restart(struct restart_block *restart)
{
u32 __user *uaddr = restart->futex.uaddr;
- ktime_t t, *tp = NULL;
+ ktime_t *tp = NULL;
+
+ if (restart->futex.flags & FLAGS_HAS_TIMEOUT)
+ tp = &restart->futex.time;
- if (restart->futex.flags & FLAGS_HAS_TIMEOUT) {
- t = restart->futex.time;
- tp = &t;
- }
restart->fn = do_no_restart_syscall;
return (long)futex_wait(uaddr, restart->futex.flags,
next prev parent reply other threads:[~2025-11-14 15:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 9:38 [PATCH 0/3] restart_block: simplify expiration timestamps Thomas Weißschuh
2025-11-10 9:38 ` [PATCH 1/3] select: store end_time as timespec64 in restart block Thomas Weißschuh
2025-11-10 11:07 ` Jan Kara
2025-11-10 9:38 ` [PATCH 2/3] futex: Store time as ktime_t " Thomas Weißschuh
2025-11-10 11:09 ` Jan Kara
2025-11-14 15:33 ` tip-bot2 for Thomas Weißschuh [this message]
2025-11-10 9:38 ` [PATCH 3/3] hrtimer: " Thomas Weißschuh
2025-11-14 15:33 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh
2025-11-11 9:48 ` [PATCH 0/3] restart_block: simplify expiration timestamps Christian Brauner
2025-11-11 9:57 ` Peter Zijlstra
2025-11-14 15:29 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176313439408.498.1645769750771932244.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.weissschuh@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®