From: Florian Schmidt <mista.tapas@gmx.net>
To: Florian Schmidt <mista.tapas@gmx.net>
Cc: Lee Revell <rlrevell@joe-job.com>,
Paul Davis <paul@linuxaudiosystems.com>,
Jaroslav Kysela <perex@suse.cz>, Ingo Molnar <mingo@elte.hu>,
jackit-devel@lists.sourceforge.net,
alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: Re: [Jackit-devel] irq handler top half timestamps
Date: Sat, 11 Dec 2004 03:22:14 +0100 [thread overview]
Message-ID: <20041211032214.5121a003@mango.fruits.de> (raw)
In-Reply-To: <20041211015610.1798af34@mango.fruits.de>
On Sat, 11 Dec 2004 01:56:10 +0100
Florian Schmidt <mista.tapas@gmx.net> wrote:
> > With Ingo's patches we actually have 3 levels of IRQ context, they
> > effectively add a level above the traditional "top half" which is just a
> > tiny asm routine to mark the IRQ thread runnable (if threaded) or
> > execute the "real" top half directly if nonthreaded.
>
> I see. For the best estimate, the timestamp would have to be taken as
> soon as possible after the irq was raised. For this purpose alone it
> would be great if that tiny asm routine actually would do the
> timestamping, but i assume this would introduce some overhead (dunno, if
> 2 or 3 operations, or whatever is needed to read the TSC would really
> count, but with the number of irqs happening, it might be
> significant[??]). Also there would certainly extra code be needed to
> pass this info along to the next irq handler stage..
Oh, i almost forgot: Ingo has already posted a patch adding this to the
threaded irq handlers in recent RP kernels. ALSA could access it. But
making ALSA depend on a kernel feature of an experimental kernel might
be unwise (uneducated guess).
Also this leaves the question of using a different timer source for the
timestamps in the case that TSC is unreliable open.
Is it sensible to require users of jackd to not use cpu freq scaling
during operation? If so, we could just settle on using the TSC.
Flo
* Ingo Molnar <mingo@elte.hu> wrote:
> the jackd IRQ timestamps are something different. We could record a
> timestamp in the tophalf handler, and let ALSA access it - the patch
> below implements this. [...]
new patch that actually compiles attached.
Ingo
--- linux/kernel/irq/handle.c.orig
+++ linux/kernel/irq/handle.c
@@ -138,6 +138,11 @@ fastcall int handle_IRQ_event(unsigned i
return retval;
}
+cycles_t irq_timestamp(unsigned int irq)
+{
+ return irq_desc[irq].timestamp;
+}
+
/*
* do_IRQ handles all normal device IRQ's (the special
* SMP cross-CPU interrupts have their own specific
@@ -163,6 +168,7 @@ fastcall notrace unsigned int __do_IRQ(u
desc->handler->end(irq);
return 1;
}
+ desc->timestamp = get_cycles();
spin_lock(&desc->lock);
desc->handler->ack(irq);
--- linux/include/linux/irq.h.orig
+++ linux/include/linux/irq.h
@@ -77,6 +77,7 @@ typedef struct irq_desc {
unsigned int irqs_unhandled;
struct task_struct *thread;
wait_queue_head_t wait_for_handler;
+ cycles_t timestamp;
raw_spinlock_t lock;
} ____cacheline_aligned irq_desc_t;
@@ -101,6 +102,7 @@ extern int can_request_irq(unsigned int
extern void early_init_hardirqs(void);
extern void init_hardirqs(void);
extern void init_irq_proc(void);
+extern cycles_t irq_timestamp(unsigned int irq);
#else
static inline void early_init_hardirqs(void) { }
static inline void init_hardirqs(void) { }
--
Palimm Palimm!
http://affenbande.org/~tapas/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
next prev parent reply other threads:[~2004-12-11 2:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041209180706.GA11397@elte.hu>
[not found] ` <200412091819.iB9IJiLX013123@localhost.localdomain>
[not found] ` <20041209183342.GB13132@elte.hu>
[not found] ` <20041209220741.7562b6a0@mango.fruits.de>
2004-12-09 21:10 ` irq handler top half timestamps Lee Revell
2004-12-10 1:35 ` Re: [Jackit-devel] " Florian Schmidt
2004-12-10 7:52 ` [Alsa-devel] " Jaroslav Kysela
2004-12-10 17:23 ` Florian Schmidt
2004-12-10 17:17 ` Re: [Jackit-devel] " Paul Davis
2004-12-10 17:54 ` [Alsa-devel] " Florian Schmidt
2004-12-10 19:00 ` Re: [Jackit-devel] " Lee Revell
2004-12-10 20:51 ` Paul Davis
2004-12-10 21:01 ` Lee Revell
2004-12-11 0:56 ` Florian Schmidt
2004-12-11 2:22 ` Florian Schmidt [this message]
2004-12-15 23:32 ` [Alsa-devel] " Florian Schmidt
2004-12-16 9:18 ` Ingo Molnar
2004-12-16 16:33 ` tapas
2004-12-16 18:35 ` Re: [Jackit-devel] " Lee Revell
2004-12-19 23:45 ` Florian Schmidt
2004-12-19 23:38 ` [Alsa-devel] " Lee Revell
2004-12-20 15:08 ` Re: [Jackit-devel] " Florian Schmidt
2004-12-21 1:30 ` [Alsa-devel] " Florian Schmidt
2004-12-21 1:49 ` Re: [Jackit-devel] " Lee Revell
2004-12-11 3:17 ` [Alsa-devel] " Lee Revell
2004-12-20 10:57 ` Re: [Jackit-devel] " Martijn Sipkema
2004-12-20 11:10 ` Clemens Ladisch
2004-12-20 11:50 ` Martijn Sipkema
2004-12-20 11:52 ` [Alsa-devel] " James Courtier-Dutton
2004-12-10 7:41 ` Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041211032214.5121a003@mango.fruits.de \
--to=mista.tapas@gmx.net \
--cc=alsa-devel@lists.sourceforge.net \
--cc=jackit-devel@lists.sourceforge.net \
--cc=mingo@elte.hu \
--cc=paul@linuxaudiosystems.com \
--cc=perex@suse.cz \
--cc=rlrevell@joe-job.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.