Skip to contentSkip to conversation

Profile likely/unlikely macros -v2

PATCH Hua Zhong 1 participant 2 messages Apr 27, 2006

lore
Share & tools
lore

Hua Zhong

author
#0 lore raw
Quoted 1 line

I cannot use this patch until we find a workaround.

Well, this is the workaround I used. :-)

I'm glad you've seen this too. Maybe someone on the list could figure out the real fix.

arch/i386/kernel/cpu/intel_cacheinfo.c +1 -1
index c8547a6..c33182a 100644
@@ -571,7 +571,7 @@ static int __cpuinit cpuid4_cache_sysfs_
 		return -ENOENT;
 
 	/* Allocate all required memory */
-	cache_kobject[cpu] = kmalloc(sizeof(struct kobject), GFP_KERNEL);
+	cache_kobject[cpu] = __kmalloc(sizeof(struct kobject), GFP_KERNEL);
 	if (unlikely(cache_kobject[cpu] == NULL))
 		goto err_out;
 	memset(cache_kobject[cpu], 0, sizeof(struct kobject));
author
#1 lore raw

Actually, this seems a better fix. Clearly the unlikely and that particular kmalloc don't play well together. However, the same setup a couple of lines later have no issue.

arch/i386/kernel/cpu/intel_cacheinfo.c +1 -1
index c8547a6..9dfcf0e 100644
@@ -572,7 +572,7 @@ static int __cpuinit cpuid4_cache_sysfs_
 
 	/* Allocate all required memory */
 	cache_kobject[cpu] = kmalloc(sizeof(struct kobject), GFP_KERNEL);
-	if (unlikely(cache_kobject[cpu] == NULL))
+	if (cache_kobject[cpu] == NULL)
 		goto err_out;
 	memset(cache_kobject[cpu], 0, sizeof(struct kobject));