[Devel] [PATCH RHEL7 COMMIT] ms/sched/numa: Fix initialization of sched_domain_topology for NUMA

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 3 08:27:30 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.6
------>
commit 384a4643220fffd9001172e16ea54396a3675ab6
Author: Andrey Ryabinin <aryabinin at odin.com>
Date:   Thu Sep 3 19:27:30 2015 +0400

    ms/sched/numa: Fix initialization of sched_domain_topology for NUMA
    
    https://jira.sw.ru/browse/PSBM-26429
    
    From: Vincent Guittot <vincent.guittot at linaro.org>
    
    commit c515db8cd311ef77b2dc7cbd6b695022655bb0f3 upstream.
    
    Jet Chen has reported a kernel panics when booting qemu-system-x86_64 with
    kvm64 cpu. A panic occured while building the sched_domain.
    
    In sched_init_numa, we create a new topology table in which both default
    levels and numa levels are copied. The last row of the table must have a null
    pointer in the mask field.
    
    The current implementation doesn't add this last row in the computation of the
    table size. So we add 1 row in the allocation size that will be used as the
    last row of the table. The kzalloc will ensure that the mask field is NULL.
    
    Reported-by: Jet Chen <jet.chen at intel.com>
    Tested-by: Jet Chen <jet.chen at intel.com>
    Signed-off-by: Vincent Guittot <vincent.guittot at linaro.org>
    Signed-off-by: Peter Zijlstra <peterz at infradead.org>
    Cc: fengguang.wu at intel.com
    Link: http://lkml.kernel.org/r/1399972261-25693-1-git-send-email-vincent.guittot@linaro.org
    Signed-off-by: Ingo Molnar <mingo at kernel.org>
    Signed-off-by: Andrey Ryabinin <aryabinin at odin.com>
    
    Signed-off-by: Andrey Ryabinin <aryabinin at odin.com>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 30f39a25..df63b3a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6827,7 +6827,7 @@ static void sched_init_numa(void)
 	/* Compute default topology size */
 	for (i = 0; sched_domain_topology[i].mask; i++);
 
-	tl = kzalloc((i + level) *
+	tl = kzalloc((i + level + 1) *
 			sizeof(struct sched_domain_topology_level), GFP_KERNEL);
 	if (!tl)
 		return;



More information about the Devel mailing list