[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <qzqldbanacnrdwtqbgplxmgucfzijelq5mhciyykldok6pocwr@mdkezu5pinxa>
Date: Mon, 10 Nov 2025 12:09:25 +0100
From: Jan Kara <jack@...e.cz>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Darren Hart <dvhart@...radead.org>, Davidlohr Bueso <dave@...olabs.net>,
André Almeida <andrealmeid@...lia.com>, Anna-Maria Behnsen <anna-maria@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] futex: Store time as ktime_t in restart block
On Mon 10-11-25 10:38:52, Thomas Weißschuh wrote:
> The futex core uses ktime_t to represent times,
> use that also for the restart block.
>
> This also allows the simplification of the accessors.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> 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 0798a4ae67c6c75749c38c4673ab8ea012261319..3c2bd13f609120a8a914f6e738ffea97bf72c32d 100644
> --- a/include/linux/restart_block.h
> +++ b/include/linux/restart_block.h
> @@ -33,7 +33,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 e2bbe5509ec27a18785227358d4ff8d8f913ddc1..1c2dd03f11ec4e5d34d1a9f67ef01e05604b3bac 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,
>
> --
> 2.51.0
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists