All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Rotolo <steve.rotolo@ccur.com>
To: linux-kernel@vger.kernel.org
Cc: bugsy@ccur.com
Subject: SD_SHARE_CPUPOWER breaks scheduler fairness
Date: Tue, 31 May 2005 13:46:48 -0400	[thread overview]
Message-ID: <1117561608.1439.168.camel@whiz> (raw)

The SD_SHARE_CPUPOWER flag in SMT scheduling domains (hyperthread
systems) can starve out sched_other tasks and even hang the system.  A
long-running (or run-away) sched_fifo task causes sched_other tasks to
get stuck on the sibling cpu's runqueue without any chance to run.  The
sibling cpu simply stays idle with tasks on it's runqueue for as long as
the sched_fifo task runs on the other sibling cpu.  The culprit is
dependent_sleeper() in sched.c.

I guess the SD_SHARE_CPUPOWER is supposed to cause the scheduler to
prohibit non-real-time tasks from running on a cpu while a real-time
task is running on the sibling cpu.  The problem is that sched_other
tasks are not migrated to a different runqueue and essentially get stuck
on a dead runqueue until either the sched_fifo task yields or the
load-balancer moves him.  Unfortunately, the load-balancer will never
migrate the task if the runqueue length is not sufficiently out of
balance.  Even more unfortunate, the load-balancer will actually move
tasks *to* the dead runqueue if it is less busy.  And still worse, since
SD_WAKE_IDLE is also set in the scheduling domain, the dead cpu will
actually attract waking tasks to it because it is idle!  The cpu becomes
a sort-of black-hole sucking in innocent tasks so they can no longer
run.

The worst-case scenario is when there are N spinning sched_fifo tasks on
an N-way hyperthreaded system.  This hangs the system since nothing can
run on the virtual cpus.  If you turn off the SD_SHARE_CPUPOWER flag,
the system stays fully functional until you have N*2 spinners hogging
all the virtual cpus.

I get the same behavior from 2.6.9 to 2.6.12-rc5.  So is this a bug or a
feature?

-- 
Steve Rotolo
Concurrent Computer Corporation


             reply	other threads:[~2005-05-31 17:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-31 17:46 Steve Rotolo [this message]
2005-06-01  2:49 ` SD_SHARE_CPUPOWER breaks scheduler fairness Con Kolivas
2005-06-01 14:29   ` Steve Rotolo
2005-06-01 14:47     ` Con Kolivas
2005-06-01 18:41       ` Steve Rotolo
2005-06-01 21:37         ` Con Kolivas
2005-06-01 21:54           ` Con Kolivas
2005-06-01 22:01           ` Steve Rotolo
2005-06-02  3:01             ` Con Kolivas
2005-06-01 23:16           ` Joe Korty
2005-06-01 23:25             ` Con Kolivas
2005-06-02 13:30               ` Steve Rotolo
2005-06-02 13:34                 ` Con Kolivas
2005-06-02 15:48                   ` Steve Rotolo
2005-06-03  0:43                     ` [PATCH] SCHED: run SCHED_NORMAL tasks with real time tasks on SMT siblings Con Kolivas

Reply instructions:

You may reply publicly 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1117561608.1439.168.camel@whiz \
    --to=steve.rotolo@ccur.com \
    --cc=bugsy@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.