Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-19 Thread Manfred Spraul
On 09/18/2016 09:11 PM, Davidlohr Bueso wrote: Our sysv sems have been using the notion of lockless wakeups for a while, ever since 0a2b9d4c796 (ipc/sem.c: move wake_up_process out of the spinlock section), in order to reduce the sem_lock hold times. This in-house pending queue can be replaced

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-19 Thread Manfred Spraul
On 09/18/2016 09:11 PM, Davidlohr Bueso wrote: Our sysv sems have been using the notion of lockless wakeups for a while, ever since 0a2b9d4c796 (ipc/sem.c: move wake_up_process out of the spinlock section), in order to reduce the sem_lock hold times. This in-house pending queue can be replaced

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-18 Thread Davidlohr Bueso
On Sun, 18 Sep 2016, Manfred Spraul wrote: + Why this empty line? That's my fat fingers, will remove it. + } + + sem_unlock(sma, locknum); + rcu_read_unlock(); + wake_up_q(_q); + + goto

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-18 Thread Davidlohr Bueso
On Sun, 18 Sep 2016, Manfred Spraul wrote: + Why this empty line? That's my fat fingers, will remove it. + } + + sem_unlock(sma, locknum); + rcu_read_unlock(); + wake_up_q(_q); + + goto

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-18 Thread Manfred Spraul
Hi Davidlohr, On 09/12/2016 01:53 PM, Davidlohr Bueso wrote: @@ -1933,22 +1823,32 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, queue.alter = alter; error = perform_atomic_semop(sma, ); - if (error == 0) { - /* If the operation was

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-18 Thread Manfred Spraul
Hi Davidlohr, On 09/12/2016 01:53 PM, Davidlohr Bueso wrote: @@ -1933,22 +1823,32 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, queue.alter = alter; error = perform_atomic_semop(sma, ); - if (error == 0) { - /* If the operation was

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-14 Thread Davidlohr Bueso
On Tue, 13 Sep 2016, Manfred Spraul wrote: + if ((error = queue.status) != -EINTR && !signal_pending(current)) { + /* +* User space could assume that semop() is a memory barrier: +* Without the mb(), the cpu could speculatively read in user +

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-14 Thread Davidlohr Bueso
On Tue, 13 Sep 2016, Manfred Spraul wrote: + if ((error = queue.status) != -EINTR && !signal_pending(current)) { + /* +* User space could assume that semop() is a memory barrier: +* Without the mb(), the cpu could speculatively read in user +

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-13 Thread Manfred Spraul
Hi Davidlohr, On 09/12/2016 01:53 PM, Davidlohr Bueso wrote: Hmeansembench-sem-482965735.00 ( 0.00%) 1040313.00 ( 7.72%) [...] Signed-off-by: Davidlohr Bueso --- ipc/sem.c | 268 +++--- 1 file changed, 83

Re: [PATCH 2/5] ipc/sem: rework task wakeups

2016-09-13 Thread Manfred Spraul
Hi Davidlohr, On 09/12/2016 01:53 PM, Davidlohr Bueso wrote: Hmeansembench-sem-482965735.00 ( 0.00%) 1040313.00 ( 7.72%) [...] Signed-off-by: Davidlohr Bueso --- ipc/sem.c | 268 +++--- 1 file changed, 83 insertions(+),