LKML Archive on
 help / color / Atom feed
From: Mike Galbraith <>
To: Steven Rostedt <>
Cc: Peter Zijlstra <>,
	Ingo Molnar <>, LKML <>
Subject: [PATCH] sched/cpupri: fix cpupri_find() for high priority tasks
Date: Wed, 09 Apr 2014 05:50:10 +0200
Message-ID: <> (raw)

Hi Steven,

Seems c92211d9b7727 introduced a buglet.


Bail on task_pri >= MAX_RT_PRIO excludes userspace prio 98 and 99 tasks,
which map to 100 and 101 respectively.

A user reported that given two SCHED_RR tasks, one hog, one light, the light
task may be stacked on top of the hog iff prio >= 98, latency hit follows.

Signed-off-by: Mike Galbraith <>
Cc: <>
Fixes: c92211d9b7727 sched/cpupri: Remove the vec->lock
 kernel/sched/cpupri.c |    3 ---
 1 file changed, 3 deletions(-)

--- a/kernel/sched/cpupri.c
+++ b/kernel/sched/cpupri.c
@@ -70,9 +70,6 @@ int cpupri_find(struct cpupri *cp, struc
 	int idx = 0;
 	int task_pri = convert_prio(p->prio);
-	if (task_pri >= MAX_RT_PRIO)
-		return 0;
 	for (idx = 0; idx < task_pri; idx++) {
 		struct cpupri_vec *vec  = &cp->pri_to_cpu[idx];
 		int skip = 0;

             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09  3:50 Mike Galbraith [this message]
2014-04-13 13:40 ` Steven Rostedt
2014-04-13 13:48   ` Steven Rostedt
2014-05-08 10:41 ` [tip:sched/core] sched: Use CPUPRI_NR_PRIORITIES instead of MAX_RT_PRIO in cpupri check tip-bot for Steven Rostedt (Red Hat)

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone