Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-10 Thread Paul E. McKenney
On Thu, Jun 09, 2016 at 07:36:40PM +0200, Peter Zijlstra wrote: > On Thu, Jun 09, 2016 at 03:40:58PM +0100, David Howells wrote: > > Peter Zijlstra wrote: > > > > > Blergh; so looking at more asm there's still a few tricks we cannot do. > > > So while overall size is down,

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-10 Thread Paul E. McKenney
On Thu, Jun 09, 2016 at 07:36:40PM +0200, Peter Zijlstra wrote: > On Thu, Jun 09, 2016 at 03:40:58PM +0100, David Howells wrote: > > Peter Zijlstra wrote: > > > > > Blergh; so looking at more asm there's still a few tricks we cannot do. > > > So while overall size is down, some paths do end up

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-09 Thread Peter Zijlstra
On Thu, Jun 09, 2016 at 03:40:58PM +0100, David Howells wrote: > Peter Zijlstra wrote: > > > Blergh; so looking at more asm there's still a few tricks we cannot do. > > So while overall size is down, some paths do end up more expensive. (It > > typically boils down to

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-09 Thread Peter Zijlstra
On Thu, Jun 09, 2016 at 03:40:58PM +0100, David Howells wrote: > Peter Zijlstra wrote: > > > Blergh; so looking at more asm there's still a few tricks we cannot do. > > So while overall size is down, some paths do end up more expensive. (It > > typically boils down to creative use of condition

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-09 Thread David Howells
Peter Zijlstra wrote: > Blergh; so looking at more asm there's still a few tricks we cannot do. > So while overall size is down, some paths do end up more expensive. (It > typically boils down to creative use of condition flags, which is very > hard in C) It can be done

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-09 Thread David Howells
Peter Zijlstra wrote: > Blergh; so looking at more asm there's still a few tricks we cannot do. > So while overall size is down, some paths do end up more expensive. (It > typically boils down to creative use of condition flags, which is very > hard in C) It can be done using ISO

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-03 Thread Peter Zijlstra
On Fri, Jun 03, 2016 at 06:13:39PM +0200, Peter Zijlstra wrote: > So I've been playing with this again because Jason's atomic_long_t > patches made a mess of things. > > (similar findings for both ia64 and s390, suggesting killing all > arch/*/include/asm/rwsem.h might actuyally be an option). >

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-03 Thread Peter Zijlstra
On Fri, Jun 03, 2016 at 06:13:39PM +0200, Peter Zijlstra wrote: > So I've been playing with this again because Jason's atomic_long_t > patches made a mess of things. > > (similar findings for both ia64 and s390, suggesting killing all > arch/*/include/asm/rwsem.h might actuyally be an option). >

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-03 Thread Peter Zijlstra
On Wed, Feb 03, 2016 at 09:10:16AM +0100, Ingo Molnar wrote: > > * Michal Hocko wrote: > > > From: Michal Hocko > > > > x86 implementation of __down_write is using inline asm to optimize the > > code flow. This however requires that it has go over an

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-06-03 Thread Peter Zijlstra
On Wed, Feb 03, 2016 at 09:10:16AM +0100, Ingo Molnar wrote: > > * Michal Hocko wrote: > > > From: Michal Hocko > > > > x86 implementation of __down_write is using inline asm to optimize the > > code flow. This however requires that it has go over an additional hop > > for the slow path

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-02-03 Thread Michal Hocko
On Wed 03-02-16 09:10:16, Ingo Molnar wrote: > > * Michal Hocko wrote: > > > From: Michal Hocko > > > > x86 implementation of __down_write is using inline asm to optimize the > > code flow. This however requires that it has go over an additional hop > > for the slow path

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-02-03 Thread Ingo Molnar
* Michal Hocko wrote: > From: Michal Hocko > > x86 implementation of __down_write is using inline asm to optimize the > code flow. This however requires that it has go over an additional hop > for the slow path call_rwsem_down_write_failed which has to > save_common_regs/restore_common_regs

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-02-03 Thread Ingo Molnar
* Michal Hocko wrote: > From: Michal Hocko > > x86 implementation of __down_write is using inline asm to optimize the > code flow. This however requires that it has go over an additional hop > for the slow path call_rwsem_down_write_failed which has to >

Re: [RFC 10/12] x86, rwsem: simplify __down_write

2016-02-03 Thread Michal Hocko
On Wed 03-02-16 09:10:16, Ingo Molnar wrote: > > * Michal Hocko wrote: > > > From: Michal Hocko > > > > x86 implementation of __down_write is using inline asm to optimize the > > code flow. This however requires that it has go over an additional hop > > for

[RFC 10/12] x86, rwsem: simplify __down_write

2016-02-02 Thread Michal Hocko
From: Michal Hocko x86 implementation of __down_write is using inline asm to optimize the code flow. This however requires that it has go over an additional hop for the slow path call_rwsem_down_write_failed which has to save_common_regs/restore_common_regs to preserve the calling convention.

[RFC 10/12] x86, rwsem: simplify __down_write

2016-02-02 Thread Michal Hocko
From: Michal Hocko x86 implementation of __down_write is using inline asm to optimize the code flow. This however requires that it has go over an additional hop for the slow path call_rwsem_down_write_failed which has to save_common_regs/restore_common_regs to preserve the