mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: miaox@cn.fujitsu.com
Cc: "Lai Jiangshan" <laijs@cn.fujitsu.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Avi Kivity" <avi@qumranet.com>,
	linux-kernel@vger.kernel.org,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [BUG] CFS vs cpu hotplug
Date: Mon, 7 Jul 2008 13:31:41 +0200	[thread overview]
Message-ID: <b647ffbd0807070431x633c9d88x8104801bd0efdc20@mail.gmail.com> (raw)
In-Reply-To: <4871EF49.6000501@cn.fujitsu.com>

2008/7/7 Miao Xie <miaox@cn.fujitsu.com>:
> on 3:59 Lai Jiangshan wrote:
>> Dmitry Adamushko wrote:
>>>
>>> [ ... ]
>>>
>>> We should see then all tasks that have been migrated (or failed to be
>>> migrated) during migration_call(CPU_DEAD, ...).
>>>
>> Thank you. I'll test it again with your debugging patch applied
>> and get more info.
>
> I tested it with Dmitry's patch, and found that all the tasks on the offline
> cpu were migrated to an online cpu by migrate_live_tasks() in migration_call().
> But some tasks(such as klogd and so on)was moved back to the offline cpu
> immediately before BUG_ON(rq->nr_running != 0) checking, even before acquiring
> rq's lock.
>
>        static int __cpuinit
>        migration_call(struct notifier_block *nfb, unsigned long action, void *
>        {
>                ...
>                switch (action) {
>                ...
>                case CPU_DEAD:
>                case CPU_DEAD_FROZEN:
>                        cpuset_lock();
>                        migrate_live_tasks(cpu);
>                        rq = cpu_rq(cpu);
>                        ...
>                        spin_lock_irq(&rq->lock);
>                        ...
>                        migrate_dead_tasks(cpu);
>                        spin_unlock_irq(&rq->lock);
>                        cpuset_unlock();
>                        migrate_nr_uninterruptible(rq);
>                        BUG_ON(rq->nr_running != 0);
>                        ...
>                        break;
>                }
>                ...
>        }
>
> By debuging, I found this bug was caused by select_task_rq_fair().

Thanks for tracking this down!


> After migrating the tasks on the offline cpu to an online cpu, the kernel would
> wake up these migrated tasks quickly by try_to_wake_up(). try_to_wake_up() would
> invoke select_task_rq_fair() to find a lower-load cpu in sched domains for them.
> But the sched domains weren't updated and the offline cpu was still in the sched
> domains.

Hmm... if so, then this should be fixed, not select_task_rq_fair(). I
don't think this is expected behavior.


> So select_task_rq_fair() might return the offline cpu's id, then the
> bug occurred.
>
> I fix the bug just by checking the select_task_rq_fair()'s return value in
> try_to_wake_up().
>
> [ ... ]


-- 
Best regards,
Dmitry Adamushko

  reply	other threads:[~2008-07-07 11:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 16:19 Heiko Carstens
2008-06-19 18:05 ` Peter Zijlstra
2008-06-19 18:14   ` Peter Zijlstra
2008-06-19 21:14     ` Heiko Carstens
2008-06-19 21:26       ` Peter Zijlstra
2008-06-19 21:17   ` Heiko Carstens
2008-06-19 21:32   ` Peter Zijlstra
2008-06-19 21:49     ` Heiko Carstens
2008-06-20  8:51       ` Peter Zijlstra
2008-06-20 22:19         ` Heiko Carstens
2008-06-20 11:44   ` Dmitry Adamushko
2008-06-20 22:23     ` Heiko Carstens
2008-06-25 22:12 ` Dmitry Adamushko
2008-06-28 22:16   ` Dmitry Adamushko
2008-06-29  6:55     ` Ingo Molnar
2008-06-30  9:07     ` Heiko Carstens
2008-06-30  9:17       ` Ingo Molnar
2008-07-01  9:22         ` Lai Jiangshan
2008-07-01  9:31           ` Ingo Molnar
2008-07-01 10:09             ` Lai Jiangshan
2008-07-02  7:13             ` Lai Jiangshan
2008-07-02  8:50               ` Dmitry Adamushko
2008-07-02  9:23                 ` Lai Jiangshan
2008-07-07 10:26                   ` Miao Xie
2008-07-07 11:31                     ` Dmitry Adamushko [this message]
2008-07-09 22:32 Dmitry Adamushko
2008-07-10  7:30 ` Heiko Carstens
2008-07-10  7:39   ` Ingo Molnar

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=b647ffbd0807070431x633c9d88x8104801bd0efdc20@mail.gmail.com \
    --to=dmitry.adamushko@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=avi@qumranet.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaox@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome