public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Fix get_model_name() for mixed cpu type systems
@ 2006-10-18 21:25 Jack Steiner
  2006-10-18 21:44 ` Stephane Eranian
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Jack Steiner @ 2006-10-18 21:25 UTC (permalink / raw)
  To: linux-ia64


If a system consists of mixed processor types, kmalloc()
can be called before the per-cpu data page is initialized. 
If the slab contains sufficient memory, then kmalloc() works
ok. However, if the slabs are empty, slab calls the memory
allocator. This requires per-cpu data (NODE_DATA()) & the
cpu dies.

	Signed-off-by: Jack Steiner <steiner@sgi.com>




Index: linux/arch/ia64/kernel/setup.c
=================================--- linux.orig/arch/ia64/kernel/setup.c	2006-10-18 15:49:49.000000000 -0500
+++ linux/arch/ia64/kernel/setup.c	2006-10-18 16:19:18.261790796 -0500
@@ -643,12 +643,14 @@ struct seq_operations cpuinfo_op = {
 	.show =		show_cpuinfo
 };
 
-static char brandname[128];
+#define MAX_BRANDS	4
+static char brandname[MAX_BRANDS][128];
 
 static char * __cpuinit
 get_model_name(__u8 family, __u8 model)
 {
 	char brand[128];
+	int i;
 
 	if (ia64_pal_get_brand_info(brand)) {
 		if (family = 0x7)
@@ -660,12 +662,14 @@ get_model_name(__u8 family, __u8 model)
 		} else
 			memcpy(brand, "Unknown", 8);
 	}
-	if (brandname[0] = '\0')
-		return strcpy(brandname, brand);
-	else if (strcmp(brandname, brand) = 0)
-		return brandname;
-	else
-		return kstrdup(brand, GFP_KERNEL);
+	for (i = 0; i < MAX_BRANDS; i++)
+		if (strcmp(brandname[i], brand) = 0)
+			return brandname[i];
+	for (i = 0; i < MAX_BRANDS; i++)
+		if (brandname[i][0] = '\0')
+			return strcpy(brandname[i], brand);
+	BUG();
+	return NULL;	/* quiet compiler */
 }
 
 static void __cpuinit

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-03-12 13:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-18 21:25 [PATCH] - Fix get_model_name() for mixed cpu type systems Jack Steiner
2006-10-18 21:44 ` Stephane Eranian
2006-10-18 21:55 ` Jack Steiner
2006-10-18 22:25 ` Stephane Eranian
2006-10-18 22:38 ` Russ Anderson
2006-10-18 22:57 ` Stephane Eranian
2006-10-19  0:03 ` Luck, Tony
2006-10-19 14:08 ` Jack Steiner
2006-10-19 20:57 ` Russ Anderson
2006-10-19 21:05 ` Stephane Eranian
2006-10-19 21:21 ` Matthew Wilcox
2006-10-19 21:22 ` Luck, Tony
2006-10-19 21:29 ` Jack Steiner
2006-10-19 21:52 ` Stephane Eranian
2006-10-19 22:11 ` Stephane Eranian
2006-10-20  1:54 ` KAMEZAWA Hiroyuki
2006-10-20  2:03 ` Jack Steiner
2007-03-12 13:07 ` FW: " Jack Steiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox