Re: Attribute spinlock contention ticks to caller.

From: Keith Owens <kaos_at_sgi.com>
Date: 2005-09-15 10:10:30
On Wed, 14 Sep 2005 17:26:44 -0500, 
Robin Holt <holt@sgi.com> wrote:
>
>On larger systems, ia64_spinlock_contention frequently shows up in
>pfmon output.  Determining whether it is a frequently contended lock or
>numerous different locks is very difficult.
>
>The following patch attributes the ticks received while in
>ia64_spinlock_contention to the requestor of the lock.
>...
>@@ -165,6 +175,12 @@ default_handler(struct task_struct *task
> 	 * where did the fault happen (includes slot number)
> 	 */
> 	ent->ip = regs->cr_iip | ((regs->cr_ipsr >> 41) & 0x3);
>+#ifdef CONFIG_SMP
>+	/* Fix up the ip for code in the spinlock contention path. */
>+	if ((ent->ip >= (unsigned long)ia64_spinlock_contention) &&
>+	    (ent->ip < (unsigned long)ia64_spinlock_contention_end))
>+		ent->ip = regs->b6;
>+#endif
> 
> 	ent->tstamp    = stamp;
> 	ent->cpu       = smp_processor_id();

There is a small window at the start of ia64_spinlock_contention_pre3_4
where b6 is not defined.  It is only about 2 bundles wide and is only
executed once when a lock is contended, so you are unlikely to hit it,
just FYI.

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Sep 15 11:45:28 2005

This archive was generated by hypermail 2.1.8 : 2005-09-15 11:45:34 EST