Skip to contentSkip to conversation

- Increase max SSI size

PATCH In review Jack Steiner 4 participants 7 messages Apr 12, 2007 – May 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - Increase max SSI size

Increase the maximum SSI size for IA64 to 4096p. No changes are being made to the default configuration sizes (for now).

Index: linux/arch/ia64/Kconfig
=================================--- linux.orig/arch/ia64/Kconfig 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/Kconfig 2007-04-12 07:41:44.619991642 -0500
@@ -267,8 +267,8 @@ config SMP
If you don't know what to do here, say N.

config NR_CPUS
- int "Maximum number of CPUs (2-1024)"
- range 2 1024
+ int "Maximum number of CPUs (2-4096)"
+ range 2 4096
depends on SMP
default "1024"
help
Index: linux/arch/ia64/kernel/topology.c
=================================--- linux.orig/arch/ia64/kernel/topology.c 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/kernel/topology.c 2007-04-12 08:08:30.526370615 -0500
@@ -21,6 +21,7 @@
#include <linux/bootmem.h>
#include <linux/nodemask.h>
#include <linux/notifier.h>
+#include <linux/vmalloc.h>
#include <asm/mmzone.h>
#include <asm/numa.h>
#include <asm/cpu.h>
@@ -68,7 +69,8 @@ static int __init topology_init(void)
}
#endif

- sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+ sysfs_cpus = vmalloc(sizeof(struct ia64_cpu) * NR_CPUS);
+ memset(sysfs_cpus, 0, sizeof(sizeof(struct ia64_cpu) * NR_CPUS));
if (!sysfs_cpus)
panic("kzalloc in topology_init failed - NR_CPUS too big?");

#1 lore raw

- sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+ sysfs_cpus = vmalloc(sizeof(struct ia64_cpu) * NR_CPUS);
+ memset(sysfs_cpus, 0, sizeof(sizeof(struct ia64_cpu) * NR_CPUS));
if (!sysfs_cpus)
panic("kzalloc in topology_init failed - NR_CPUS too big?");

How about having the check "if (!sysfs_cpus)" before the memset()?

-Tony

#2 lore raw
In reply to Jack Steiner

Review

Quoted 5 lines · Jack Steiner
(quoted diff) +2 -1
-	sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+	sysfs_cpus = vmalloc(sizeof(struct ia64_cpu) * NR_CPUS);
+	memset(sysfs_cpus, 0, sizeof(sizeof(struct ia64_cpu) * NR_CPUS));
 	if (!sysfs_cpus)
 		panic("kzalloc in topology_init failed - NR_CPUS too big?");

Consider using nr_cpu_ids instead of NR_CPUS. This will allocate a smaller array on systems that support just a handful of processors.

#3 lore raw
In reply to Jack Steiner

Increase the maximum SSI size for IA64 to 4096p. No changes are being made to the default configuration sizes (for now).

---
With bug fix that Tony found....

Index: linux/arch/ia64/Kconfig
=================================--- linux.orig/arch/ia64/Kconfig 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/Kconfig 2007-04-12 07:41:44.619991642 -0500
@@ -267,8 +267,8 @@ config SMP
If you don't know what to do here, say N.

config NR_CPUS
- int "Maximum number of CPUs (2-1024)"
- range 2 1024
+ int "Maximum number of CPUs (2-4096)"
+ range 2 4096
depends on SMP
default "1024"
help
Index: linux/arch/ia64/kernel/topology.c
=================================--- linux.orig/arch/ia64/kernel/topology.c 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/kernel/topology.c 2007-04-12 13:37:05.855795475 -0500
@@ -21,6 +21,7 @@
#include <linux/bootmem.h>
#include <linux/nodemask.h>
#include <linux/notifier.h>
+#include <linux/vmalloc.h>
#include <asm/mmzone.h>
#include <asm/numa.h>
#include <asm/cpu.h>
@@ -68,10 +69,11 @@ static int __init topology_init(void)
}
#endif

- sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+ sysfs_cpus = vmalloc(sizeof(struct ia64_cpu) * NR_CPUS);
if (!sysfs_cpus)
panic("kzalloc in topology_init failed - NR_CPUS too big?");

+ memset(sysfs_cpus, 0, sizeof(sizeof(struct ia64_cpu) * NR_CPUS));
for_each_present_cpu(i) {
if((err = arch_register_cpu(i)))
goto out;

#4 lore raw
In reply to Jack Steiner

Tony,

Did this make it onto your radar? Jack had submitted a fixed patch, but I have not seen it sent to Linus yet. Jack is on vacation right now. If you need it resubmitted, please let me know and I will impersonate him.

Thanks,
Robin

----- Forwarded message from Jack Steiner <[email protected]> -----

Date: Thu, 12 Apr 2007 13:39:01 -0500
From: Jack Steiner <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] - Increase max SSI size

Increase the maximum SSI size for IA64 to 4096p. No changes are being made to the default configuration sizes (for now).

---
With bug fix that Tony found....

Index: linux/arch/ia64/Kconfig
=================================--- linux.orig/arch/ia64/Kconfig 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/Kconfig 2007-04-12 07:41:44.619991642 -0500
@@ -267,8 +267,8 @@ config SMP
If you don't know what to do here, say N.

config NR_CPUS
- int "Maximum number of CPUs (2-1024)"
- range 2 1024
+ int "Maximum number of CPUs (2-4096)"
+ range 2 4096
depends on SMP
default "1024"
help
Index: linux/arch/ia64/kernel/topology.c
=================================--- linux.orig/arch/ia64/kernel/topology.c 2007-04-04 16:51:42.000000000 -0500
+++ linux/arch/ia64/kernel/topology.c 2007-04-12 13:37:05.855795475 -0500
@@ -21,6 +21,7 @@
#include <linux/bootmem.h>
#include <linux/nodemask.h>
#include <linux/notifier.h>
+#include <linux/vmalloc.h>
#include <asm/mmzone.h>
#include <asm/numa.h>
#include <asm/cpu.h>
@@ -68,10 +69,11 @@ static int __init topology_init(void)
}
#endif

- sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+ sysfs_cpus = vmalloc(sizeof(struct ia64_cpu) * NR_CPUS);
if (!sysfs_cpus)
panic("kzalloc in topology_init failed - NR_CPUS too big?");

+ memset(sysfs_cpus, 0, sizeof(sizeof(struct ia64_cpu) * NR_CPUS));
for_each_present_cpu(i) {
if((err = arch_register_cpu(i)))
goto out;
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

----- End forwarded message -----

#5 lore raw
In reply to Jack Steiner
Quoted 3 lines

Did this make it onto your radar? Jack had submitted a fixed patch, but I have not seen it sent to Linus yet. Jack is on vacation right now. If you need it resubmitted, please let me know and I will impersonate him.

I'd skipped over it. Just tried it though and something is wrong. I took arch/ia64/gendefconfig and tweaked the number of cpus up to 4096. When I tried to boot it on a 16-way Montecito I got an oops during boot. The full text scrolled off the screen, but the last part of the stacktrace said:

kernel_init -> topology_init -> arch_register_cpu -> register_cpu ->

    sysdev_register -> kobject_set_name -> kfree

-Tony

#6 lore raw
In reply to Jack Steiner
Quoted 11 lines · Tony
Quoted 3 lines

Did this make it onto your radar? Jack had submitted a fixed patch, but I have not seen it sent to Linus yet. Jack is on vacation right now. If you need it resubmitted, please let me know and I will impersonate him.

I'd skipped over it. Just tried it though and something is wrong. I took arch/ia64/gendefconfig and tweaked the number of cpus up to 4096. When I tried to boot it on a 16-way Montecito I got an oops during boot. The full text scrolled off the screen, but the last part of the stacktrace said:

Quoted 3 lines

kernel_init -> topology_init -> arch_register_cpu -> register_cpu ->

    sysdev_register -> kobject_set_name -> kfree

Let me give it a try.

Thanks,
Robin