Re: 2.6.9-rc4-mm1

From: Andi Kleen
Date: Mon Oct 11 2004 - 07:46:33 EST


Tim Cambrant <cambrant@xxxxxxxxxx> writes:

> On Mon, Oct 11, 2004 at 03:25:02AM -0700, Andrew Morton wrote:
>>
>> optimize-profile-path-slightly.patch
>> Optimize profile path slightly
>>
>
> I'm still getting an oops at startup with this patch. After reversing
> it, everything is fine. Weren't you supposed to remove that from your
> tree until it was fixed?

There's a fixed version around. I thought Andrew had merged that one?

-Andi

-------------------------------------

Fixed version of profile optimization


Index: linux/kernel/profile.c
===================================================================
--- linux.orig/kernel/profile.c 2004-09-30 10:35:51.%N +0200
+++ linux/kernel/profile.c 2004-10-07 13:22:33.%N +0200
@@ -181,20 +181,27 @@
EXPORT_SYMBOL_GPL(profile_event_register);
EXPORT_SYMBOL_GPL(profile_event_unregister);

-void profile_hit(int type, void *__pc)
+static inline void __profile_hit(int type, void *__pc)
{
unsigned long pc;

- if (prof_on != type || !prof_buffer)
- return;
pc = ((unsigned long)__pc - (unsigned long)_stext) >> prof_shift;
atomic_inc(&prof_buffer[min(pc, prof_len - 1)]);
}

+void profile_hit(int type, void *pc)
+{
+ if (prof_on != type || !prof_buffer)
+ return;
+ __profile_hit(type, pc);
+}
+
void profile_tick(int type, struct pt_regs *regs)
{
if (type == CPU_PROFILING)
profile_hook(regs);
+ if (prof_on != type || !prof_buffer)
+ return;
if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
profile_hit(type, (void *)profile_pc(regs));
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/