[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0271e473ddcf463bb030eb4cbecbe888@AcuMS.aculab.com>
Date: Fri, 6 Mar 2020 16:57:54 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Peter Zijlstra' <peterz@...radead.org>,
André Almeida <andrealmeid@...labora.com>
CC: Florian Weimer <fweimer@...hat.com>,
"Pierre-Loup A. Griffais" <pgriffais@...vesoftware.com>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel@...labora.com" <kernel@...labora.com>,
"krisman@...labora.com" <krisman@...labora.com>,
"shuah@...nel.org" <shuah@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"ryao@...too.org" <ryao@...too.org>,
"dvhart@...radead.org" <dvhart@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"z.figura12@...il.com" <z.figura12@...il.com>,
"steven@...vesoftware.com" <steven@...vesoftware.com>,
"steven@...uorix.net" <steven@...uorix.net>,
"malteskarupke@....de" <malteskarupke@....de>,
"carlos@...hat.com" <carlos@...hat.com>,
"adhemerval.zanella@...aro.org" <adhemerval.zanella@...aro.org>,
"libc-alpha@...rceware.org" <libc-alpha@...rceware.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>
Subject: RE: 'simple' futex interface [Was: [PATCH v3 1/4] futex: Implement
mechanism to wait on any of several futexes]
From: Peter Zijlstra
> Sent: 05 March 2020 18:52
+> On Thu, Mar 05, 2020 at 01:14:17PM -0300, André Almeida wrote:
>
> > > sys_futex_wait(void *uaddr, u64 val, unsigned long flags, ktime_t *timo);
> > > struct futex_wait {
> > > void *uaddr;
> > > u64 val;
> > > u64 flags;
> > > };
> > > sys_futex_waitv(struct futex_wait *waiters, unsigned int nr_waiters,
> > > u64 flags, ktime_t *timo);
> > > sys_futex_wake(void *uaddr, unsigned int nr, u64 flags);
> > > sys_futex_cmp_requeue(void *uaddr1, void *uaddr2, unsigned int nr_wake,
> > > unsigned int nr_requeue, u64 cmpval, unsigned long flags);
> > >
> > > And that makes 7 arguments for cmp_requeue, which can't be. Maybe we if
> > > combine nr_wake and nr_requeue in one as 2 u16... ?
> > >
> > > And then we need to go detector if the platform supports it or not..
> > >
> >
> > Thanks everyone for the feedback around our mechanism. Are the
> > performance benefits of implementing a syscall to wait on a single futex
> > significant enough to maintain it instead of just using
> > `sys_futex_waitv()` with `nr_waiters = 1`? If we join both cases in a
> > single interface, we may even add a new member for NUMA hint in `struct
> > futex_wait`.
>
> My consideration was that avoiding the get_user/copy_from_user might
> become measurable on !PTI systems with SMAP.
>
> But someone would have to build it and measure it before we can be sure
> of course.
An extra copy_from_user is likely to be noticable.
It certainly makes recvmsg() slower than recv().
Especially if the hardended usercopy crap gets involved.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists