Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-09-06 Thread Davidlohr Bueso
On Thu, 06 Sep 2018, Peter Zijlstra wrote: On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote: On Fri, 20 Jul 2018, Andrew Morton wrote: >I'm surprised. Is spin_lock_irqsave() significantly more expensive >than spin_lock_irq()? Relative to all the other stuff those functions

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-09-06 Thread Davidlohr Bueso
On Thu, 06 Sep 2018, Peter Zijlstra wrote: On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote: On Fri, 20 Jul 2018, Andrew Morton wrote: >I'm surprised. Is spin_lock_irqsave() significantly more expensive >than spin_lock_irq()? Relative to all the other stuff those functions

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-09-06 Thread Peter Zijlstra
On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > >I'm surprised. Is spin_lock_irqsave() significantly more expensive > >than spin_lock_irq()? Relative to all the other stuff those functions > >are doing? If so, how come? Some

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-09-06 Thread Peter Zijlstra
On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > >I'm surprised. Is spin_lock_irqsave() significantly more expensive > >than spin_lock_irq()? Relative to all the other stuff those functions > >are doing? If so, how come? Some

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-24 Thread Andrew Morton
On Sat, 21 Jul 2018 11:31:27 -0700 Davidlohr Bueso wrote: > On Sat, 21 Jul 2018, Peter Zijlstra wrote: > > >On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: > >> On Fri, 20 Jul 2018, Andrew Morton wrote: > >> > >> > We could open-code it locally. Add a couple of > >> >

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-24 Thread Andrew Morton
On Sat, 21 Jul 2018 11:31:27 -0700 Davidlohr Bueso wrote: > On Sat, 21 Jul 2018, Peter Zijlstra wrote: > > >On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: > >> On Fri, 20 Jul 2018, Andrew Morton wrote: > >> > >> > We could open-code it locally. Add a couple of > >> >

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Davidlohr Bueso
On Sat, 21 Jul 2018, Peter Zijlstra wrote: On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: On Fri, 20 Jul 2018, Andrew Morton wrote: > We could open-code it locally. Add a couple of > WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with > Xen but surely just

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Davidlohr Bueso
On Sat, 21 Jul 2018, Peter Zijlstra wrote: On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: On Fri, 20 Jul 2018, Andrew Morton wrote: > We could open-code it locally. Add a couple of > WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with > Xen but surely just

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Peter Zijlstra
On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > > > We could open-code it locally. Add a couple of > > WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with > > Xen but surely just reading the thing isn't too

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Peter Zijlstra
On Sat, Jul 21, 2018 at 10:21:20AM -0700, Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > > > We could open-code it locally. Add a couple of > > WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with > > Xen but surely just reading the thing isn't too

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: We could open-code it locally. Add a couple of WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with Xen but surely just reading the thing isn't too expensive? We could also pass on the responsibility to lockdep and just use

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-21 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: We could open-code it locally. Add a couple of WARN_ON_ONCE(irqs_disabled())? That might need re-benchmarking with Xen but surely just reading the thing isn't too expensive? We could also pass on the responsibility to lockdep and just use

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: Did you try measuring it on bare hardware? I did and wasn't expecting much difference. For a 2-socket 40-core (ht) IvyBridge on a few workloads, unfortunately I don't have a xen environment and the results for Xen I do have (which numbers are in

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: Did you try measuring it on bare hardware? I did and wasn't expecting much difference. For a 2-socket 40-core (ht) IvyBridge on a few workloads, unfortunately I don't have a xen environment and the results for Xen I do have (which numbers are in

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Andrew Morton
On Fri, 20 Jul 2018 13:05:59 -0700 Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > > >On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: > > > >> Hi, > >> > >> Both patches replace saving+restoring interrupts when taking the > >> ep->lock (now the waitqueue lock),

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Andrew Morton
On Fri, 20 Jul 2018 13:05:59 -0700 Davidlohr Bueso wrote: > On Fri, 20 Jul 2018, Andrew Morton wrote: > > >On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: > > > >> Hi, > >> > >> Both patches replace saving+restoring interrupts when taking the > >> ep->lock (now the waitqueue lock),

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: Hi, Both patches replace saving+restoring interrupts when taking the ep->lock (now the waitqueue lock), with just disabling local irqs. This shows immediate performance benefits in patch 1

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
On Fri, 20 Jul 2018, Andrew Morton wrote: On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: Hi, Both patches replace saving+restoring interrupts when taking the ep->lock (now the waitqueue lock), with just disabling local irqs. This shows immediate performance benefits in patch 1

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Andrew Morton
On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: > Hi, > > Both patches replace saving+restoring interrupts when taking the > ep->lock (now the waitqueue lock), with just disabling local irqs. > This shows immediate performance benefits in patch 1 for an epoll > workload running on

Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Andrew Morton
On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: > Hi, > > Both patches replace saving+restoring interrupts when taking the > ep->lock (now the waitqueue lock), with just disabling local irqs. > This shows immediate performance benefits in patch 1 for an epoll > workload running on

[PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
Hi, Both patches replace saving+restoring interrupts when taking the ep->lock (now the waitqueue lock), with just disabling local irqs. This shows immediate performance benefits in patch 1 for an epoll workload running on Xen. The main concern we need to have with this sort of changes in epoll is

[PATCH -next 0/2] fs/epoll: loosen irq safety when possible

2018-07-20 Thread Davidlohr Bueso
Hi, Both patches replace saving+restoring interrupts when taking the ep->lock (now the waitqueue lock), with just disabling local irqs. This shows immediate performance benefits in patch 1 for an epoll workload running on Xen. The main concern we need to have with this sort of changes in epoll is