Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-08-06 Thread Peter Zijlstra
On Tue, Aug 06, 2019 at 02:26:38AM -0400, Gabriel Krisman Bertazi wrote: > Peter Zijlstra writes: > > > > >> +static int futex_wait_multiple(u32 __user *uaddr, unsigned int flags, > >> + u32 count, ktime_t *abs_time) > >> +{ > >> + struct futex_wait_block *wb; > >> + str

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-08-05 Thread Gabriel Krisman Bertazi
Peter Zijlstra writes: > >> +static int futex_wait_multiple(u32 __user *uaddr, unsigned int flags, >> + u32 count, ktime_t *abs_time) >> +{ >> +struct futex_wait_block *wb; >> +struct restart_block *restart; >> +int ret; >> + >> +if (!count) >> +

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Pierre-Loup A. Griffais
On 7/31/19 6:32 PM, Zebediah Figura wrote: On 7/31/19 8:22 PM, Zebediah Figura wrote: On 7/31/19 7:45 PM, Thomas Gleixner wrote: If I assume a maximum of 65 futexes which got mentioned in one of the replies then this will allocate 7280 bytes alone for the futex_q array with a stock debian conf

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 8:22 PM, Zebediah Figura wrote: On 7/31/19 7:45 PM, Thomas Gleixner wrote: If I assume a maximum of 65 futexes which got mentioned in one of the replies then this will allocate 7280 bytes alone for the futex_q array with a stock debian config which has no debug options enabled which w

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 7:45 PM, Thomas Gleixner wrote: If I assume a maximum of 65 futexes which got mentioned in one of the replies then this will allocate 7280 bytes alone for the futex_q array with a stock debian config which has no debug options enabled which would bloat the struct. Adding the futex_wait

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Thomas Gleixner
On Tue, 30 Jul 2019, Gabriel Krisman Bertazi wrote: > + retry: > + for (i = 0; i < count; i++) { > + qs[i].key = FUTEX_KEY_INIT; > + qs[i].bitset = wb[i].bitset; > + > + ret = get_futex_key(wb[i].uaddr, flags & FLAGS_SHARED, > +

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 5:39 PM, Thomas Gleixner wrote: On Wed, 31 Jul 2019, Zebediah Figura wrote: On 7/31/19 7:06 AM, Peter Zijlstra wrote: On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Thomas Gleixner
On Wed, 31 Jul 2019, Zebediah Figura wrote: > On 7/31/19 7:06 AM, Peter Zijlstra wrote: > > On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: > > > This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows > > > a thread to wait on several futexes at the same ti

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 7:06 AM, Peter Zijlstra wrote: On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on several futexes at the same time, and be awoken by any of them. In a sense, it implement

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Peter Zijlstra
On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: > This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows > a thread to wait on several futexes at the same time, and be awoken by > any of them. In a sense, it implements one of the features that was > suppor

[PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-30 Thread Gabriel Krisman Bertazi
This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on several futexes at the same time, and be awoken by any of them. In a sense, it implements one of the features that was supported by pooling on the old FUTEX_FD interface. My use case for this operation lie