[PATCH] keep rd->online and cpu_online_map in sync

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

 



Hi Ingo, Steve, Thomas,
  Ingo pointed me at an issue on LKML/mainline regarding cpu-hotplug.
It turns out that the issue (I believe) was related to the root-domain
code that I added a few months ago.  This code is also in -rt, so the
bug should exist there as well.  This may fix the root-cause of that
s2ram bug that Mike Galbraith found and patched a while back as well.
If that is the case, we can probably get rid of the "num_online_cpus()"
in the update_migration code.  That will require confirmation from
Mike, however, as I do not have a P4 machine like his that exhibits
the bug.  For now, both patches should probably co-exist together.

This applies to 24.3-rt3

Regards,
-Greg 

------------------------------
keep rd->online and cpu_online_map in sync

It is possible to allow the root-domain cache of online cpus to
become out of sync with the global cpu_online_map.  This is because we
currently trigger removal of cpus too early in the notifier chain.
Other DOWN_PREPARE handlers may in fact run and reconfigure the
root-domain topology, thereby stomping on our own offline handling.

The end result is that rd->online may become out of sync with
cpu_online_map, which results in potential task misrouting.

So change the offline handling to be more tightly coupled with the
global offline process by triggering on CPU_DYING intead of
CPU_DOWN_PREPARE.

Signed-off-by: Gregory Haskins <ghaskins@xxxxxxxxxx>
---

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

diff --git a/kernel/sched.c b/kernel/sched.c
index 7547c70..24edc53 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6082,7 +6082,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
 		spin_unlock_irq(&rq->lock);
 		break;
 
-	case CPU_DOWN_PREPARE:
+	case CPU_DYING:
 		/* Update our root-domain */
 		rq = cpu_rq(cpu);
 		spin_lock_irqsave(&rq->lock, flags);

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

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux