Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-22 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: > > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > > > * Ingo Molnar wrote: > > > > > > > I'm testing your patches today, if they are otherwise OK [...] > > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-22 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: > > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > > > * Ingo Molnar wrote: > > > > > > > I'm testing your patches today, if they are otherwise OK [...] > > > > > > got this build failure: > > > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Borislav Petkov
On Thu, Apr 21, 2016 at 09:09:11AM -0400, Michal Hocko wrote: > Thanks Boris! This is highly appreciated. I know ;-) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Borislav Petkov
On Thu, Apr 21, 2016 at 09:09:11AM -0400, Michal Hocko wrote: > Thanks Boris! This is highly appreciated. I know ;-) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Michal Hocko
On Thu 21-04-16 13:35:16, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 03:29:30PM -0700, H. Peter Anvin wrote: > > Since it is a fixed register we could just mark edx clobbered, but > > with more flexible register constraints it can permit gcc to allocate > > a temp resister for us. -- > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Michal Hocko
On Thu 21-04-16 13:35:16, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 03:29:30PM -0700, H. Peter Anvin wrote: > > Since it is a fixed register we could just mark edx clobbered, but > > with more flexible register constraints it can permit gcc to allocate > > a temp resister for us. -- > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 03:29:30PM -0700, H. Peter Anvin wrote: > Since it is a fixed register we could just mark edx clobbered, but > with more flexible register constraints it can permit gcc to allocate > a temp resister for us. -- Right. I'll try to hack up a cleanup ontop once the dust here

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-21 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 03:29:30PM -0700, H. Peter Anvin wrote: > Since it is a fixed register we could just mark edx clobbered, but > with more flexible register constraints it can permit gcc to allocate > a temp resister for us. -- Right. I'll try to hack up a cleanup ontop once the dust here

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On April 20, 2016 2:36:37 PM PDT, Borislav Petkov wrote: >On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: >> Setting ret to sem doesn't make any sense. Just use "=a" and "a". > >Yeah, that's what Michal's patch ontop does. > >And to answer my own question: we need

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On April 20, 2016 2:36:37 PM PDT, Borislav Petkov wrote: >On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: >> Setting ret to sem doesn't make any sense. Just use "=a" and "a". > >Yeah, that's what Michal's patch ontop does. > >And to answer my own question: we need the "a" (sem)

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: > Setting ret to sem doesn't make any sense. Just use "=a" and "a". Yeah, that's what Michal's patch ontop does. And to answer my own question: we need the "a" (sem) input for the fast path. I guess we can still move "1"

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: > Setting ret to sem doesn't make any sense. Just use "=a" and "a". Yeah, that's what Michal's patch ontop does. And to answer my own question: we need the "a" (sem) input for the fast path. I guess we can still move "1"

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On 04/20/2016 01:45 PM, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: >> The reason it breaks is because the same register can't be an >> input-output register and a separate input. However, the input side of >> the input-output is probably undefined, and

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On 04/20/2016 01:45 PM, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: >> The reason it breaks is because the same register can't be an >> input-output register and a separate input. However, the input side of >> the input-output is probably undefined, and

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Michal Hocko
On Wed 20-04-16 22:45:01, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: > > The reason it breaks is because the same register can't be an > > input-output register and a separate input. However, the input side of > > the input-output is probably

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Michal Hocko
On Wed 20-04-16 22:45:01, Borislav Petkov wrote: > On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: > > The reason it breaks is because the same register can't be an > > input-output register and a separate input. However, the input side of > > the input-output is probably

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: > The reason it breaks is because the same register can't be an > input-output register and a separate input. However, the input side of > the input-output is probably undefined, and so gcc may not notice. So Michal and I talked

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Borislav Petkov
On Wed, Apr 20, 2016 at 11:04:05AM -0700, H. Peter Anvin wrote: > The reason it breaks is because the same register can't be an > input-output register and a separate input. However, the input side of > the input-output is probably undefined, and so gcc may not notice. So Michal and I talked

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On April 20, 2016 6:40:19 AM PDT, Peter Zijlstra wrote: >On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: >> On Wed 13-04-16 12:27:31, Ingo Molnar wrote: >> > >> > * Ingo Molnar wrote: >> > >> > > I'm testing your patches today, if they are

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread H. Peter Anvin
On April 20, 2016 6:40:19 AM PDT, Peter Zijlstra wrote: >On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: >> On Wed 13-04-16 12:27:31, Ingo Molnar wrote: >> > >> > * Ingo Molnar wrote: >> > >> > > I'm testing your patches today, if they are otherwise OK [...] >> > >> > got this

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Peter Zijlstra
On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > * Ingo Molnar wrote: > > > > > I'm testing your patches today, if they are otherwise OK [...] > > > > got this build failure: > > > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-20 Thread Peter Zijlstra
On Wed, Apr 13, 2016 at 02:49:43PM +0200, Michal Hocko wrote: > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > * Ingo Molnar wrote: > > > > > I'm testing your patches today, if they are otherwise OK [...] > > > > got this build failure: > > > > ./arch/x86/include/asm/rwsem.h:106:2:

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-17 Thread Michal Hocko
On Wed 13-04-16 14:49:43, Michal Hocko wrote: > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > * Ingo Molnar wrote: > > > > > I'm testing your patches today, if they are otherwise OK [...] > > > > got this build failure: > > > > ./arch/x86/include/asm/rwsem.h:106:2:

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-17 Thread Michal Hocko
On Wed 13-04-16 14:49:43, Michal Hocko wrote: > On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > > > * Ingo Molnar wrote: > > > > > I'm testing your patches today, if they are otherwise OK [...] > > > > got this build failure: > > > > ./arch/x86/include/asm/rwsem.h:106:2: error: ‘asm’

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Michal Hocko
On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > I'm testing your patches today, if they are otherwise OK [...] > > got this build failure: > > ./arch/x86/include/asm/rwsem.h:106:2: error: ‘asm’ operand has impossible > constraints Hmm, I have

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Michal Hocko
On Wed 13-04-16 12:27:31, Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > I'm testing your patches today, if they are otherwise OK [...] > > got this build failure: > > ./arch/x86/include/asm/rwsem.h:106:2: error: ‘asm’ operand has impossible > constraints Hmm, I have no idea why 64b

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Ingo Molnar wrote: > I'm testing your patches today, if they are otherwise OK [...] got this build failure: ./arch/x86/include/asm/rwsem.h:106:2: error: ‘asm’ operand has impossible constraints with the attached config and with: gcc version 5.3.1 20151207 (Red Hat

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Ingo Molnar wrote: > I'm testing your patches today, if they are otherwise OK [...] got this build failure: ./arch/x86/include/asm/rwsem.h:106:2: error: ‘asm’ operand has impossible constraints with the attached config and with: gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC)

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Michal Hocko wrote: > On Wed 13-04-16 11:08:30, Ingo Molnar wrote: > > > > * Michal Hocko wrote: > [...] > > > +ENTRY(call_rwsem_down_write_failed_killable) > > > + save_common_regs > > > + movq %rax,%rdi > > > + call rwsem_down_write_failed_killable >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Michal Hocko wrote: > On Wed 13-04-16 11:08:30, Ingo Molnar wrote: > > > > * Michal Hocko wrote: > [...] > > > +ENTRY(call_rwsem_down_write_failed_killable) > > > + save_common_regs > > > + movq %rax,%rdi > > > + call rwsem_down_write_failed_killable > > > + restore_common_regs > > > + ret

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Michal Hocko
On Wed 13-04-16 11:08:30, Ingo Molnar wrote: > > * Michal Hocko wrote: [...] > > +ENTRY(call_rwsem_down_write_failed_killable) > > + save_common_regs > > + movq %rax,%rdi > > + call rwsem_down_write_failed_killable > > + restore_common_regs > > + ret > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Michal Hocko
On Wed 13-04-16 11:08:30, Ingo Molnar wrote: > > * Michal Hocko wrote: [...] > > +ENTRY(call_rwsem_down_write_failed_killable) > > + save_common_regs > > + movq %rax,%rdi > > + call rwsem_down_write_failed_killable > > + restore_common_regs > > + ret > >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Michal Hocko wrote: > From: Michal Hocko > > which uses the same fast path as __down_write except it falls back to > call_rwsem_down_write_failed_killable slow path and return -EINTR if > killed. To prevent from code duplication extract the skeleton of >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-13 Thread Ingo Molnar
* Michal Hocko wrote: > From: Michal Hocko > > which uses the same fast path as __down_write except it falls back to > call_rwsem_down_write_failed_killable slow path and return -EINTR if > killed. To prevent from code duplication extract the skeleton of > __down_write into a helper macro

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-07 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-07 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the semaphore and the

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-06 Thread Peter Zijlstra
On Fri, Apr 01, 2016 at 01:04:54PM +0200, Michal Hocko wrote: > diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S > index 40027db99140..d1a1397e1fb3 100644 > --- a/arch/x86/lib/rwsem.S > +++ b/arch/x86/lib/rwsem.S > @@ -101,6 +101,14 @@ ENTRY(call_rwsem_down_write_failed) > ret >

Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-06 Thread Peter Zijlstra
On Fri, Apr 01, 2016 at 01:04:54PM +0200, Michal Hocko wrote: > diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S > index 40027db99140..d1a1397e1fb3 100644 > --- a/arch/x86/lib/rwsem.S > +++ b/arch/x86/lib/rwsem.S > @@ -101,6 +101,14 @@ ENTRY(call_rwsem_down_write_failed) > ret >

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-01 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-04-01 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the semaphore and the

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-02-29 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the

[PATCH 10/11] x86, rwsem: provide __down_write_killable

2016-02-29 Thread Michal Hocko
From: Michal Hocko which uses the same fast path as __down_write except it falls back to call_rwsem_down_write_failed_killable slow path and return -EINTR if killed. To prevent from code duplication extract the skeleton of __down_write into a helper macro which just takes the semaphore and the