From: "Dmitry Adamushko" <dmitry.adamushko@gmail.com>
To: "Max Krasnyansky" <maxk@qualcomm.com>
Cc: mingo@elte.hu, a.p.zijlstra@chello.nl,
torvalds@linux-foundation.org, pj@sgi.com, ghaskins@novell.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment (take 2)
Date: Wed, 16 Jul 2008 23:55:30 +0200 [thread overview]
Message-ID: <b647ffbd0807161455gf9b36ddwea8a843832adf66b@mail.gmail.com> (raw)
In-Reply-To: <487E5A15.8030302@qualcomm.com>
2008/7/16 Max Krasnyansky <maxk@qualcomm.com>:
>
>
> Dmitry Adamushko wrote:
>> 2008/7/15 Max Krasnyansky <maxk@qualcomm.com>:
>>> From: Max Krasnyanskiy <maxk@qualcomm.com>
>>>
>>> Addressed Ingo's comments and merged on top of latest Linus's tree.
>>
>> a few remarks:
>>
>> (1) in __migrate_task(), a test for !cpu_active(dest_cpu) should be
>> done after double_rq_lock() [ or add the second one ]
>>
>> migration_thread() calls __migrate_task() with disabled interrupts (no
>> rq-locks held), i.e. if we merely rely on rq-locks for
>> synchronization, this can race with cpu_down(dest_cpu).
>>
>> [ assume, the test was done in __migration_task() and it's about to
>> take double_lock()... and at this time, down_cpu(dest_cpu) starts and
>> completes on another CPU ]
>>
>> note, we may still take the rq-lock for a "dead" cpu in this case and
>> then only do a check (remark: in fact, not with stop_machine() in
>> place _but_ I consider that we don't make any assumptions on its
>> behavior);
> Hmm, as you suggested I added synchronize_sched() after clearing the active
> bit (see below). Is that not nought enough ? I mean you mentioned that
> stop_machine syncs things up, I assume synchronize_sched does too.
Yes, sorry for the noise here.
* synchronize_sched - block until all CPUs have exited any non-preemptive
* kernel code sequences
so "any non-preemptive" sections, not just the ones with run-queue
locks being held.
>> (2) it's worth to take a look at the use of any_online_cpu():
>>
>> many places are ok, because there will be an additional check against
>> cpu_active_mask later on, but e.g.
>>
>> set_cpus_allowed_ptr() ->
>> migrate_task(p, any_online_cpu(mask), ...) ->
>> migrate_task(p, dest_cpu)
>>
>> doesn't seem to have any verifications wrt cpu_active_map.
> How about we just introduce any_active_cpu() and replace all the usages of
> any_online_cpu() in the scheduler ?
I think, at least for places related to task placement (like
migrate_task(..., any_online_cpu()) it would make sense,
consistency-wise.
>
> Max
>
--
Best regards,
Dmitry Adamushko
next prev parent reply other threads:[~2008-07-16 21:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 11:43 Max Krasnyansky
2008-07-15 11:49 ` Marcel Holtmann
2008-07-15 11:52 ` Peter Zijlstra
2008-07-15 11:57 ` Marcel Holtmann
2008-07-15 12:03 ` Peter Zijlstra
2008-07-15 15:24 ` Linus Torvalds
2008-07-15 12:45 ` Gregory Haskins
2008-07-15 15:22 ` Linus Torvalds
2008-07-16 8:57 ` Dmitry Adamushko
2008-07-16 20:29 ` Max Krasnyansky
2008-07-16 21:55 ` Dmitry Adamushko [this message]
2008-07-16 12:12 ` Gregory Haskins
2008-07-16 21:44 ` Max Krasnyansky
2008-07-17 2:51 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redosched " Gregory Haskins
2008-07-17 7:16 ` Max Krasnyansky
2008-07-17 11:57 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redoscheddomain " Gregory Haskins
2008-07-17 18:52 ` Max Krasnyansky
2008-07-17 19:46 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redoscheddomainmanagment " Gregory Haskins
2008-07-18 11:53 ` Peter Zijlstra
2008-07-18 12:22 ` [PATCH] cpu hotplug, sched:Introduce " Gregory Haskins
2008-07-22 5:10 ` Max Krasnyansky
2008-07-22 14:06 ` Gregory Haskins
2008-07-22 14:16 ` Peter Zijlstra
2008-07-22 14:17 ` Gregory Haskins
2008-07-22 14:26 ` Peter Zijlstra
2008-07-22 14:45 ` Gregory Haskins
2008-07-22 19:32 ` Max Krasnyansky
2008-08-11 13:11 ` Gregory Haskins
2008-08-11 21:57 ` Max Krasnyansky
2008-07-18 11:30 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment " 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=b647ffbd0807161455gf9b36ddwea8a843832adf66b@mail.gmail.com \
--to=dmitry.adamushko@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qualcomm.com \
--cc=mingo@elte.hu \
--cc=pj@sgi.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome