Re: [PATCH v2] net: Generalise wq_has_sleeper helper

2015-11-30 Thread David Miller
From: Herbert Xu Date: Thu, 26 Nov 2015 13:55:39 +0800 > The memory barrier in the helper wq_has_sleeper is needed by just > about every user of waitqueue_active. This patch generalises it > by making it take a wait_queue_head_t directly. The existing > helper is renamed to skwq_has_sleeper. >

[PATCH v2] net: Generalise wq_has_sleeper helper

2015-11-25 Thread Herbert Xu
On Wed, Nov 25, 2015 at 11:37:29AM -0500, David Miller wrote: > > > Would be easier to refer to the comment that now adorns > > waitqueue_active(). > > Yeah, that might be a good idea. Herbert can you adjust this? Sure, here is an updated patch. Note that this patch is based on net-next where t

Re: net: Generalise wq_has_sleeper helper

2015-11-25 Thread David Miller
From: Peter Zijlstra Date: Wed, 25 Nov 2015 10:15:33 +0100 > On Tue, Nov 24, 2015 at 01:54:23PM +0800, Herbert Xu wrote: >> + * The race for tcp fires when the __add_wait_queue changes done by CPU1 >> stay >> + * in its cache, and so does the tp->rcv_nxt update on CPU2 side. The CPU1 >> + * cou

Re: net: Generalise wq_has_sleeper helper

2015-11-25 Thread Peter Zijlstra
On Tue, Nov 24, 2015 at 01:54:23PM +0800, Herbert Xu wrote: > diff --git a/include/linux/wait.h b/include/linux/wait.h > index 1e1bf9f..bd1157f 100644 > --- a/include/linux/wait.h > +++ b/include/linux/wait.h > @@ -107,6 +107,50 @@ static inline int waitqueue_active(wait_queue_head_t *q) > re

Re: net: Generalise wq_has_sleeper helper

2015-11-24 Thread Herbert Xu
On Tue, Nov 24, 2015 at 04:30:25PM -0500, David Miller wrote: > > I'm fine with wherever this patch goes. Herbert is there any > particular tree where it'll facilitate another user quickest? > > Or should I just toss it into net-next? > > Acked-by: David S. Miller No Dave net-next is fine I th

Re: net: Generalise wq_has_sleeper helper

2015-11-24 Thread David Miller
From: Herbert Xu Date: Tue, 24 Nov 2015 13:54:23 +0800 > On Wed, Nov 11, 2015 at 05:48:29PM +0800, Herbert Xu wrote: >> >> BTW, the networking folks found this years ago and even added >> helpers to deal with this. See for example wq_has_sleeper in >> include/net/sock.h. It would be good if we

net: Generalise wq_has_sleeper helper

2015-11-23 Thread Herbert Xu
On Wed, Nov 11, 2015 at 05:48:29PM +0800, Herbert Xu wrote: > > BTW, the networking folks found this years ago and even added > helpers to deal with this. See for example wq_has_sleeper in > include/net/sock.h. It would be good if we can move some of > those helpers into wait.h instead. Here is