+ cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     cpu-hotplug: register update_sched_domains() notifier with higher prio
has been added to the -mm tree.  Its filename is
     cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: cpu-hotplug: register update_sched_domains() notifier with higher prio
From: Gautham R Shenoy <ego@xxxxxxxxxx>

The current -rt wake_up logic uses the rq->rd->online_map which is updated on
cpu-hotplug events by update_sched_domains().  Currently
update_sched_domains() is registered with a priority 0.  It is preferable that
update_sched_domains() be the first notifier called on a CPU_DEAD or
CPU_ONLINE events inorder to ensure that the rq->rd->online_map is in sync
with the cpu_online_map.

This way on a CPU_DOWN_PREPARE, we would destroy the sched_domains and
reattach all the rq's to the def_root_domain.  This will be followed by a
CPU_DOWN_PREPARE in migration_call() which will clear the bit of the cpu going
offline from the corresponding rq.  This will ensure that no task will be
woken up on the cpu which is going to be offlined between CPU_DOWN_PREPARE and
CPU_DEAD.

Ditto for the CPU_ONLINE path.

Tested on a 4-way Intel Xeon Box with cpu-hotplug tests running in parallel
with kernbench.

(akpm: might fix my poweroff-doesnt-work regression)

Signed-off-by: Gautham R Shenoy <ego@xxxxxxxxxx>
Cc: Gregory Haskins <ghaskins@xxxxxxxxxx>
Cc: "Siddha, Suresh B" <suresh.b.siddha@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: "Rafael J. Wysocki" <rjw@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/sched.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN kernel/sched.c~cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio kernel/sched.c
--- a/kernel/sched.c~cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio
+++ a/kernel/sched.c
@@ -7095,8 +7095,16 @@ void __init sched_init_smp(void)
 	if (cpus_empty(non_isolated_cpus))
 		cpu_set(smp_processor_id(), non_isolated_cpus);
 	put_online_cpus();
-	/* XXX: Theoretical race here - CPU may be hotplugged now */
-	hotcpu_notifier(update_sched_domains, 0);
+	/*
+	 * XXX: Theoretical race here - CPU may be hotplugged now
+	 *
+	 * We register the notifier with priority 11, which means that
+	 * update_sched_domains() will be called just before migration_call().
+	 *
+	 * This is necessary to ensure that the rt wake up logic works fine
+	 * and the rq->rd->online_map remains in sync with the cpu_online_map.
+	 */
+	hotcpu_notifier(update_sched_domains, 11);
 
 	/* Move init over to a non-isolated CPU */
 	if (set_cpus_allowed(current, non_isolated_cpus) < 0)
_

Patches currently in -mm which might be from ego@xxxxxxxxxx are

poweroff-workaround.patch
cpu-fix-section-mismatch-warnings-in-hotcpu_register.patch
cpu-fix-section-mismatch-warning-in-unregister_cpu_notifier.patch
cpu-fix-section-mismatch-warnings-in-cpu_down.patch
cpu-fix-section-mismatch-warning-in-reference-to-register_cpu_notifier.patch
add-rcu_assign_index-if-ever-needed-fix.patch
simplify-cpu_hotplug_begin-put_online_cpus.patch
cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux