lkml.org 
[lkml]   [2015]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/2] sched/wait: add round robin wakeup mode
On Mon, Feb 09, 2015 at 08:05:57PM +0000, 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,
> unsigned flags = curr->flags;
>
> if (curr->func(curr, mode, wake_flags, key) &&
> - (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
> + (flags & WQ_FLAG_EXCLUSIVE) && !--nr_exclusive) {
> + if (flags & WQ_FLAG_ROUND_ROBIN)
> + list_move_tail(&curr->task_list, &q->task_list);
> break;
> + }
> }
> }

I think you meant to write something like:

if (curr->func(curr, mode, wake_flags, key) &&
(flags & WQ_FLAG_EXCLUSIVE)) {
if (flag & WQ_FLAG_ROUND_ROBIN)
list_move_tail(&curr->task_list, &q->task_list);
if (!--nr_exclusive)
break;
}

Otherwise can only work for nr_exclusive==1.


\
 
 \ /
  Last update: 2015-02-09 23:01    [W:0.074 / U:7.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site