From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, David Ahern <dsahern@gmail.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: [BUG] kernel freezes with latest tree
Date: Wed, 11 Jan 2012 17:58:22 +0100 [thread overview]
Message-ID: <1326301102.2442.171.camel@twins> (raw)
In-Reply-To: <CA+55aFyyBpDR_oYu9EizwPf63q3Q=44Yw_jXd0Ozk0Ei1TtZJQ@mail.gmail.com>
On Wed, 2012-01-11 at 08:31 -0800, Linus Torvalds wrote:
> On Wed, Jan 11, 2012 at 8:05 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > Ah, right! Silly me. One possibility is to rotate that list, except that
> > won't work for the cgroup case where we have another iteration.
>
> I just wonder whether you *really* need that loop at all?
>
> If something went wrong with the attempted task move - you raced with
> another cpu, or whatever - is there any real reason to even bother to
> try again?
>
> It's just a heuristic, after all, and we'll come back to balancing later.
>
> The minimal patch looks good, but I did want to ask whether people
> have considered just removing the looping entirely?
Yeah, I did consider it, and given the current code it doesn't really
make a difference either way. But ideally we'll go fix the code to
provide better progress over repeated attempts.
Esp for people who put the migration count rather low (-rt crackpots)
multiple rounds (provided progress) make more sense.
Something like the below snippet improves the progress for !cgroup
kernels, but it also defeats the regular termination condition since any
list with two or more elements will endlessly rotate until we hit the
break limit.
We could fix this by adding an iteration count and limit that to
nr_running I guess, but since world and dog compiles kernels with cgroup
muck these days we need something slightly more clever to deal with the
for_each_leaf_cfs_rq() loop in load_balance_fair().
Will ponder more..
---
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3244,8 +3246,10 @@ balance_tasks(struct rq *this_rq, int th
if ((p->se.load.weight >> 1) > rem_load_move ||
!can_migrate_task(p, busiest, this_cpu, sd, idle,
- lb_flags))
+ lb_flags)) {
+ list_move_tail(&p->se.group_node, &busiest_cfs_rq->tasks);
continue;
+ }
pull_task(busiest, p, this_rq, this_cpu);
pulled++;
next prev parent reply other threads:[~2012-01-11 16:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-10 4:57 [BUG] kernel freezes with latest tree Eric Dumazet
2012-01-10 5:03 ` Eric Dumazet
2012-01-10 8:16 ` Eric Dumazet
2012-01-10 16:13 ` Eric Dumazet
2012-01-10 16:28 ` Linus Torvalds
2012-01-10 16:37 ` Eric Dumazet
2012-01-10 16:49 ` Linus Torvalds
2012-01-10 16:53 ` Eric Dumazet
2012-01-10 17:00 ` Linus Torvalds
2012-01-10 19:32 ` Ingo Molnar
2012-01-10 22:23 ` Eric Dumazet
2012-01-10 23:44 ` Linus Torvalds
2012-01-11 6:35 ` David Ahern
2012-01-11 9:04 ` Peter Zijlstra
2012-01-11 10:28 ` Eric Dumazet
2012-01-11 11:29 ` Eric Dumazet
2012-01-11 12:25 ` Peter Zijlstra
2012-01-11 13:24 ` Eric Dumazet
2012-01-11 15:56 ` Ingo Molnar
2012-01-11 16:05 ` Peter Zijlstra
2012-01-11 16:14 ` Ingo Molnar
2012-01-11 16:31 ` Linus Torvalds
2012-01-11 16:58 ` Peter Zijlstra [this message]
2012-01-12 6:17 ` [tip:sched/urgent] sched: Fix lockup by limiting load-balance retries on lock-break tip-bot for Peter Zijlstra
2012-01-11 8:22 ` [BUG] kernel freezes with latest tree Eric Dumazet
2012-01-11 14:20 ` Frederic Weisbecker
2012-01-10 16:16 ` Linus Torvalds
2012-01-10 16:33 ` Eric Dumazet
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=1326301102.2442.171.camel@twins \
--to=peterz@infradead.org \
--cc=dsahern@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=schwidefsky@de.ibm.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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.