lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 20 Jun 2012 12:12:18 -0700 From: "Luck, Tony" <tony.luck@...el.com> To: Peter Zijlstra <a.p.zijlstra@...llo.nl> Cc: Linus Torvalds <torvalds@...ux-foundation.org>, Andrew Morton <akpm@...ux-foundation.org>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>, Paul Turner <pjt@...gle.com>, Suresh Siddha <suresh.b.siddha@...el.com>, Mike Galbraith <efault@....de>, "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>, Lai Jiangshan <laijs@...fujitsu.com>, Dan Smith <danms@...ibm.com>, Bharata B Rao <bharata.rao@...il.com>, Lee Schermerhorn <Lee.Schermerhorn@...com>, Andrea Arcangeli <aarcange@...hat.com>, Rik van Riel <riel@...hat.com>, Johannes Weiner <hannes@...xchg.org>, linux-kernel@...r.kernel.org, linux-mm@...ck.org Subject: [PATCH] sched: Fix build problems when CONFIG_NUMA=y and CONFIG_SMP=n It is possible to have a single cpu system with both local and remote memory. Signed-off-by: Tony Luck <tony.luck@...el.com> --- Broken in linux-next for the past couple of days. Perhaps we need some more stubs though - sched_fork() seems to need #ifdef CONFIG_SMP around every other line ... not pretty. Another approach would be to outlaw such strange configurations and make sure that CONFIG_SMP is set whenever CONFIG_NUMA is set. We had such a discussion a long time ago, and at that time decided to keep supporting it. But with multi-core cpus now the norm - perhaps it is time to change our minds. kernel/sched/core.c | 2 ++ kernel/sched/numa.c | 16 ++++++++++++++++ kernel/sched/sched.h | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 46460ac..f261599 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1799,7 +1799,9 @@ void sched_fork(struct task_struct *p) #endif put_cpu(); +#ifdef CONFIG_SMP select_task_node(p, p->mm, SD_BALANCE_FORK); +#endif } /* diff --git a/kernel/sched/numa.c b/kernel/sched/numa.c index 002f71c..4ff3b7c 100644 --- a/kernel/sched/numa.c +++ b/kernel/sched/numa.c @@ -18,6 +18,21 @@ #include "sched.h" +#ifndef CONFIG_SMP +void mm_init_numa(struct mm_struct *mm) +{ +} +void exit_numa(struct mm_struct *mm) +{ +} +void account_numa_dequeue(struct task_struct *p) +{ +} +__init void init_sched_numa(void) +{ +} +#else + static const int numa_balance_interval = 2 * HZ; /* 2 seconds */ struct numa_ops { @@ -853,3 +868,4 @@ static __init int numa_init(void) return 0; } early_initcall(numa_init); +#endif diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4134d37..9bf5ba8 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -473,7 +473,7 @@ struct rq { static inline struct list_head *offnode_tasks(struct rq *rq) { -#ifdef CONFIG_NUMA +#if defined(CONFIG_NUMA) && defined(CONFIG_SMP) return &rq->offnode_tasks; #else return NULL; -- 1.7.10.2.552.gaa3bb87 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists