Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-11 Thread Peter Zijlstra
On Thu, Dec 10, 2020 at 01:33:25PM -0600, Eric W. Biederman wrote: > Peter Zijlstra writes: > > > On Tue, Dec 08, 2020 at 12:27:39PM -0600, Eric W. Biederman wrote: > >> Peter Zijlstra writes: > >> > >> > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: > >> > > >> >> Do you w

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-10 Thread Eric W. Biederman
Peter Zijlstra writes: > On Tue, Dec 08, 2020 at 12:27:39PM -0600, Eric W. Biederman wrote: >> Peter Zijlstra writes: >> >> > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: >> > >> >> Do you want to pull these two into a topic branch in the tip tree >> >> based on v10-rc1? >

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-09 Thread Peter Zijlstra
On Tue, Dec 08, 2020 at 12:27:39PM -0600, Eric W. Biederman wrote: > Peter Zijlstra writes: > > > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: > > > >> Do you want to pull these two into a topic branch in the tip tree > >> based on v10-rc1? > > > > I'll go do that. I'll let

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread Eric W. Biederman
Peter Zijlstra writes: > On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: > >> Do you want to pull these two into a topic branch in the tip tree >> based on v10-rc1? > > I'll go do that. I'll let the robots chew on it before pushing it out > though, I'll reply once it's in tip.g

RE: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread David Laight
From: Waiman Long > Sent: 08 December 2020 15:34 > > On 12/8/20 4:12 AM, David Laight wrote: > > From: Waiman Long > >> Sent: 07 December 2020 19:02 > > ... > >>> How much more difficult would it be to also add a timeout option? > >>> I looked at adding one to the mutex code - and fell into a big

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread Waiman Long
On 12/8/20 4:12 AM, David Laight wrote: From: Waiman Long Sent: 07 December 2020 19:02 ... How much more difficult would it be to also add a timeout option? I looked at adding one to the mutex code - and fell into a big pile of replicated code. ISTM that one the initial locked exchange (and s

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread Peter Zijlstra
On Mon, Dec 07, 2020 at 09:56:34AM -0600, Eric W. Biederman wrote: > Do you want to pull these two into a topic branch in the tip tree > based on v10-rc1? I'll go do that. I'll let the robots chew on it before pushing it out though, I'll reply once it's in tip.git.

RE: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread David Laight
From: Peter Zijlstra > Sent: 08 December 2020 12:32 > > On Tue, Dec 08, 2020 at 09:12:36AM +, David Laight wrote: > > From: Waiman Long > > > Sent: 07 December 2020 19:02 > > ... > > > > How much more difficult would it be to also add a timeout option? > > > > I looked at adding one to the mut

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread Peter Zijlstra
On Tue, Dec 08, 2020 at 09:12:36AM +, David Laight wrote: > From: Waiman Long > > Sent: 07 December 2020 19:02 > ... > > > How much more difficult would it be to also add a timeout option? > > > I looked at adding one to the mutex code - and fell into a big pile > > > of replicated code. > > >

RE: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-08 Thread David Laight
From: Waiman Long > Sent: 07 December 2020 19:02 ... > > How much more difficult would it be to also add a timeout option? > > I looked at adding one to the mutex code - and fell into a big pile > > of replicated code. > > > > ISTM that one the initial locked exchange (and spin) fails a few > > ext

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread Waiman Long
On 12/7/20 11:58 AM, David Laight wrote: From: Waiman Long Sent: 07 December 2020 15:34 On 12/7/20 4:02 AM, Peter Zijlstra wrote: On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: On 12/3/20 3:11 PM, Eric W. Biederman wrote: +static inline int __down_read_interruptible(struct rw_s

RE: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread David Laight
From: Waiman Long > Sent: 07 December 2020 15:34 > > On 12/7/20 4:02 AM, Peter Zijlstra wrote: > > On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: > >> On 12/3/20 3:11 PM, Eric W. Biederman wrote: > >>> +static inline int __down_read_interruptible(struct rw_semaphore *sem) > >>> +{ >

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread Eric W. Biederman
Peter Zijlstra writes: > On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: >> On 12/3/20 3:11 PM, Eric W. Biederman wrote: > >> > +static inline int __down_read_interruptible(struct rw_semaphore *sem) >> > +{ >> > + if (!rwsem_read_trylock(sem)) { >> > + if (IS_ERR(rwsem_down

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread Waiman Long
On 12/7/20 4:02 AM, Peter Zijlstra wrote: On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: On 12/3/20 3:11 PM, Eric W. Biederman wrote: +static inline int __down_read_interruptible(struct rw_semaphore *sem) +{ + if (!rwsem_read_trylock(sem)) { + if (IS_ERR(rwsem_

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-07 Thread Peter Zijlstra
On Thu, Dec 03, 2020 at 08:59:13PM -0500, Waiman Long wrote: > On 12/3/20 3:11 PM, Eric W. Biederman wrote: > > +static inline int __down_read_interruptible(struct rw_semaphore *sem) > > +{ > > + if (!rwsem_read_trylock(sem)) { > > + if (IS_ERR(rwsem_down_read_slowpath(sem, TASK_INTERR

Re: [PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-03 Thread Waiman Long
On 12/3/20 3:11 PM, Eric W. Biederman wrote: In preparation for converting exec_update_mutex to a rwsem so that multiple readers can execute in parallel and not deadlock, add down_read_interruptible. This is needed for perf_event_open to be converted (with no semantic changes) from working on a

[PATCH 2/3] rwsem: Implement down_read_interruptible

2020-12-03 Thread Eric W. Biederman
In preparation for converting exec_update_mutex to a rwsem so that multiple readers can execute in parallel and not deadlock, add down_read_interruptible. This is needed for perf_event_open to be converted (with no semantic changes) from working on a mutex to wroking on a rwsem. Cc: Peter Zijls