All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs
Date: Wed, 17 Nov 2004 09:19:53 +1100	[thread overview]
Message-ID: <419A7D09.4080001@bigpond.net.au> (raw)
In-Reply-To: <20041116113209.GA1890@elte.hu>

Ingo Molnar wrote:
> PREEMPT_RT on SMP systems triggered weird (very high) load average
> values rather easily, which turned out to be a mainline kernel
> ->nr_uninterruptible handling bug in try_to_wake_up().
> 
> the following code:
> 
>         if (old_state == TASK_UNINTERRUPTIBLE) {
>                 old_rq->nr_uninterruptible--;
> 
> potentially executes with old_rq potentially being != rq, and hence
> updating ->nr_uninterruptible without the lock held. Given a
> sufficiently concurrent preemption workload the count can get out of
> whack and updates might get lost, permanently skewing the global count. 
> Nothing except the load-average uses nr_uninterruptible() so this
> condition can go unnoticed quite easily.
> 
> the fix is to update ->nr_uninterruptible always on the runqueue where
> the task currently is. (this is also a tiny performance plus for
> try_to_wake_up() as a stackslot gets freed up.)

Couldn't this part of the problem have been solved by using an atomic_t 
for nr_uninterruptible as for nr_iowait?  It would also remove the need 
for migrate_nr_uninterruptible().

Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

  reply	other threads:[~2004-11-16 22:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16 11:32 [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs Ingo Molnar
2004-11-16 22:19 ` Peter Williams [this message]
2004-11-16 23:28   ` Ingo Molnar
2004-11-16 23:10     ` Linus Torvalds
2004-11-17 10:26       ` Ingo Molnar
2004-11-17 15:52         ` Linus Torvalds
2004-11-18 16:21           ` Ingo Molnar
2005-01-28  0:53       ` Paul Jackson
2005-01-28  1:06         ` Linus Torvalds
2005-01-28  2:14           ` Paul Jackson
2005-01-28  4:28         ` Ingo Molnar
2005-01-28  5:18           ` Paul Jackson
2005-01-28  6:01           ` Andi Kleen
2004-11-16 23:48     ` Peter Williams
2004-11-16 22:49 ` Nick Piggin
2004-11-16 23:03   ` Nick Piggin
2004-11-16 23:32   ` Peter Williams
2004-11-16 23:37     ` Nick Piggin

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=419A7D09.4080001@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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.