* [PATCH] powerpc: Linux cannot run with 0 cores
@ 2010-06-18 0:33 Anton Blanchard
2010-06-18 18:02 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2010-06-18 0:33 UTC (permalink / raw)
To: benh, paulmck; +Cc: linuxppc-dev
If we configure with CONFIG_SMP=n or set NR_CPUS less than the number of
SMT threads we will set the max cores property to 0 in the
ibm,client-architecture-support structure. On new versions of firmware that
understand this property it obliges and terminates our partition.
Use DIV_ROUND_UP so we handle not only the CONFIG_SMP=n case but also the
case where NR_CPUS isn't a multiple of the number of SMT threads.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-2.6/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/prom_init.c 2010-06-17 09:08:20.000000000 +1000
+++ linux-2.6/arch/powerpc/kernel/prom_init.c 2010-06-17 09:10:02.000000000 +1000
@@ -872,7 +872,7 @@ static void __init prom_send_capabilitie
"ibm_architecture_vec structure inconsistent: 0x%x !\n",
*cores);
} else {
- *cores = NR_CPUS / prom_count_smt_threads();
+ *cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
prom_printf("Max number of cores passed to firmware: 0x%x\n",
(unsigned long)*cores);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: Linux cannot run with 0 cores
2010-06-18 0:33 [PATCH] powerpc: Linux cannot run with 0 cores Anton Blanchard
@ 2010-06-18 18:02 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2010-06-18 18:02 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
On Fri, Jun 18, 2010 at 10:33:06AM +1000, Anton Blanchard wrote:
>
> If we configure with CONFIG_SMP=n or set NR_CPUS less than the number of
> SMT threads we will set the max cores property to 0 in the
> ibm,client-architecture-support structure. On new versions of firmware that
> understand this property it obliges and terminates our partition.
>
> Use DIV_ROUND_UP so we handle not only the CONFIG_SMP=n case but also the
> case where NR_CPUS isn't a multiple of the number of SMT threads.
Thank you, Anton!!!
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
(Will test as soon as the system that hit this becomes available.)
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux-2.6/arch/powerpc/kernel/prom_init.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/kernel/prom_init.c 2010-06-17 09:08:20.000000000 +1000
> +++ linux-2.6/arch/powerpc/kernel/prom_init.c 2010-06-17 09:10:02.000000000 +1000
> @@ -872,7 +872,7 @@ static void __init prom_send_capabilitie
> "ibm_architecture_vec structure inconsistent: 0x%x !\n",
> *cores);
> } else {
> - *cores = NR_CPUS / prom_count_smt_threads();
> + *cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
> prom_printf("Max number of cores passed to firmware: 0x%x\n",
> (unsigned long)*cores);
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-18 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-18 0:33 [PATCH] powerpc: Linux cannot run with 0 cores Anton Blanchard
2010-06-18 18:02 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).