Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Peter Zijlstra
On Tue, Feb 10, 2015 at 10:59:01AM -0500, Jason Baron wrote: > hmmm...but don't we need the head/tail of the list to add it back too? Ah, good point that ;-) > Further, we can't just append to tail while walking the list b/c > otherwise it can result in multiple wakeups to the same item. So I

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Jason Baron
On 02/10/2015 04:03 AM, Peter Zijlstra wrote: > On Mon, Feb 09, 2015 at 11:06:17PM -0500, Jason Baron wrote: >> On 02/09/2015 04:50 PM, Peter Zijlstra wrote: >>> On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Peter Zijlstra
On Mon, Feb 09, 2015 at 11:06:17PM -0500, Jason Baron wrote: > On 02/09/2015 04:50 PM, Peter Zijlstra wrote: > > On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: > >> diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c > >> index 852143a..17d1039 100644 > >> ---

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Jason Baron
On 02/10/2015 04:03 AM, Peter Zijlstra wrote: On Mon, Feb 09, 2015 at 11:06:17PM -0500, Jason Baron wrote: On 02/09/2015 04:50 PM, Peter Zijlstra wrote: On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 852143a..17d1039

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Peter Zijlstra
On Tue, Feb 10, 2015 at 10:59:01AM -0500, Jason Baron wrote: hmmm...but don't we need the head/tail of the list to add it back too? Ah, good point that ;-) Further, we can't just append to tail while walking the list b/c otherwise it can result in multiple wakeups to the same item. So I could

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-10 Thread Peter Zijlstra
On Mon, Feb 09, 2015 at 11:06:17PM -0500, Jason Baron wrote: On 02/09/2015 04:50 PM, Peter Zijlstra wrote: On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 852143a..17d1039 100644 --- a/kernel/sched/wait.c +++

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
On 02/09/2015 04:50 PM, Peter Zijlstra wrote: > On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: >> diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c >> index 852143a..17d1039 100644 >> --- a/kernel/sched/wait.c >> +++ b/kernel/sched/wait.c >> @@ -71,8 +71,11 @@ static void

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Peter Zijlstra
On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: > diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c > index 852143a..17d1039 100644 > --- a/kernel/sched/wait.c > +++ b/kernel/sched/wait.c > @@ -71,8 +71,11 @@ static void __wake_up_common(wait_queue_head_t *q, > unsigned int

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Michael Kerrisk
[CC += linux-...@vger.kernel.org] On Mon, Feb 9, 2015 at 9:05 PM, Jason Baron wrote: > The motivation for this flag is to allow the distribution of wakeups from > a shared source in a balanced manner. Currently, we can add threads > exclusively > but that often results in the same thread woken

[PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
The motivation for this flag is to allow the distribution of wakeups from a shared source in a balanced manner. Currently, we can add threads exclusively but that often results in the same thread woken up again and again. In the case where we are trying to balance work across threads this is not

[PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
The motivation for this flag is to allow the distribution of wakeups from a shared source in a balanced manner. Currently, we can add threads exclusively but that often results in the same thread woken up again and again. In the case where we are trying to balance work across threads this is not

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Jason Baron
On 02/09/2015 04:50 PM, Peter Zijlstra wrote: On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 852143a..17d1039 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -71,8 +71,11 @@ static void

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Michael Kerrisk
[CC += linux-...@vger.kernel.org] On Mon, Feb 9, 2015 at 9:05 PM, Jason Baron jba...@akamai.com wrote: The motivation for this flag is to allow the distribution of wakeups from a shared source in a balanced manner. Currently, we can add threads exclusively but that often results in the same

Re: [PATCH 1/2] sched/wait: add round robin wakeup mode

2015-02-09 Thread Peter Zijlstra
On Mon, Feb 09, 2015 at 08:05:57PM +, Jason Baron wrote: diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 852143a..17d1039 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -71,8 +71,11 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,