All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] optimise rthal_timer locking
@ 2006-06-21 21:26 Jan Kiszka
  2006-06-21 21:37 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2006-06-21 21:26 UTC (permalink / raw)
  To: xenomai-core


[-- Attachment #1.1: Type: text/plain, Size: 329 bytes --]

Hi,

long pending in my tree, I finally decided to role this one out as it is
quite lone-standing:

This patch avoids to additionally switch off the local IRQs in
rthal_timer_program_shot for the PIPELINE_HEAD case - the caller is
expected to hold the nucleus lock with IRQs off anyway. Applies to i386
and ia64.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: rthal-timer-locking.patch --]
[-- Type: text/x-patch; name="rthal-timer-locking.patch", Size: 1968 bytes --]

Index: include/asm-i386/hal.h
===================================================================
--- include/asm-i386/hal.h	(Revision 1135)
+++ include/asm-i386/hal.h	(Arbeitskopie)
@@ -177,9 +177,13 @@ rthal_time_t rthal_get_8254_tsc(void);
 
 static inline void rthal_timer_program_shot (unsigned long delay)
 {
+/* With head-optimization, callers are expected to have switched off
+   hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     unsigned long flags;
 
     rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 #ifdef CONFIG_X86_LOCAL_APIC
     if (!delay) {
         /* Kick the timer interrupt immediately. */
@@ -201,7 +205,9 @@ static inline void rthal_timer_program_s
 	outb(delay >> 8,0x40);
     }
 #endif /* CONFIG_X86_LOCAL_APIC */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 }
 
 static const char *const rthal_fault_labels[] = {
Index: include/asm-ia64/hal.h
===================================================================
--- include/asm-ia64/hal.h	(Revision 1135)
+++ include/asm-ia64/hal.h	(Arbeitskopie)
@@ -65,11 +65,18 @@ static inline unsigned long long rthal_r
 
 static inline void rthal_timer_program_shot (unsigned long delay)
 {
+/* With head-optimization, callers are expected to have switched off
+   hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     unsigned long flags;
-    if (!delay) { delay = 10; }
+
     rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
+    if (!delay) { delay = 10; }
     ia64_set_itm(ia64_get_itc() + delay);
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 }
 
     /* Private interface -- Internal use only */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

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

* Re: [Xenomai-core] [PATCH] optimise rthal_timer locking
  2006-06-21 21:26 [Xenomai-core] [PATCH] optimise rthal_timer locking Jan Kiszka
@ 2006-06-21 21:37 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-06-21 21:37 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

On Wed, 2006-06-21 at 23:26 +0200, Jan Kiszka wrote:
> Hi,
> 
> long pending in my tree, I finally decided to role this one out as it is
> quite lone-standing:
> 
> This patch avoids to additionally switch off the local IRQs in
> rthal_timer_program_shot for the PIPELINE_HEAD case - the caller is
> expected to hold the nucleus lock with IRQs off anyway. Applies to i386
> and ia64.

Applied, thanks.

> 
> Jan
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.




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

end of thread, other threads:[~2006-06-21 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-21 21:26 [Xenomai-core] [PATCH] optimise rthal_timer locking Jan Kiszka
2006-06-21 21:37 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.