Re: [patch] latency-tracing-v2.6.16.patch

Bill Rugolsky Jr.
2006-03-15T22:32:33Z

On Wed, Mar 15, 2006 at 11:04:33PM +0100, Ingo Molnar wrote:
>
> * Bill Rugolsky Jr. <brugolsky@telemetry-investments.com> wrote:
>
> > Here are a pair of traces from Ingo's latency tracer running on
> > 2.6.16-rc6-git4 and 2.6.15 x86_64 SMP kernel with maxcpus=1 and
> > report_lost_ticks. [...]
>
> just for the record, the latency tracer can be found at:
>
> http://redhat.com/~mingo/latency-tracing-patches/
>
> latency-tracing-v2.6.16.patch would be the one for current upstream
> kernels. The codebase is the same as in the -rt tree.

Ingo, I had to add this incremental patch against 2.6.16-rc6-git4 in order to
get the 2.6.15-rc7 latency tracer working on x86_64. Looks like the
problem is still there in latency-tracing-v2.6.16.patch.

Regards,

Bill

--- linux-2.6.16-rc6-git4-latency/include/asm-x86_64/system.h 2006-03-15 17:19:20.000000000 -0500
+++ linux-2.6.16-rc6-git4-latency/include/asm-x86_64/system.h 2006-03-15 13:45:14.000000000 -0500
@@ -341,10 +341,8 @@
#define local_irq_disable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags & ~(1 << 9)) | (1 << 18)); } while (0)
#define local_irq_enable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags | (1 << 9)) & ~(1 << 18)); } while (0)

-#define irqs_disabled() \
+#define irqs_disabled_flags(flags) \
({ \
- unsigned long flags; \
- local_save_flags(flags); \
(flags & (1<<18)) || !(flags & (1<<9)); \
})

@@ -354,10 +352,8 @@
#define local_irq_disable() __asm__ __volatile__("cli": : :"memory")
#define local_irq_enable() __asm__ __volatile__("sti": : :"memory")

-#define irqs_disabled() \
+#define irqs_disabled_flags(flags) \
({ \
- unsigned long flags; \
- local_save_flags(flags); \
!(flags & (1<<9)); \
})

@@ -365,6 +361,13 @@
#define local_irq_save(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0)
#endif

+#define irqs_disabled() \
+({ \
+ unsigned long flags; \
+ local_save_flags(flags); \
+ irqs_disabled_flags(flags); \
+})
+
/* used in the idle loop; sti takes one instruction cycle to complete */
#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory")
/* used when interrupts are already enabled or to shutdown the processor */
--- linux-2.6.16-rc6-git4-latency/include/asm-x86_64/unistd.h 2006-03-15 17:19:20.000000000 -0500
+++ linux-2.6.16-rc6-git4-latency/include/asm-x86_64/unistd.h 2006-03-15 13:47:32.000000000 -0500
@@ -607,6 +607,7 @@
__SYSCALL(__NR_unshare, sys_unshare)

#define __NR_syscall_max __NR_unshare
+#define NR_syscalls (__NR_syscall_max+1)

#ifndef __NO_STUBS