linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RT 45-01: CF Card read: High latency?
@ 2005-04-11 11:38 kus Kusche Klaus
  2005-04-11 11:56 ` Bartlomiej Zolnierkiewicz
  2005-04-11 13:00 ` P
  0 siblings, 2 replies; 3+ messages in thread
From: kus Kusche Klaus @ 2005-04-11 11:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

>From the three sources of multi-millisecond latency in my experiments
(console messages to dead serial console, USB I/O, CF Card bulk read), 
I've analyzed one:

The latency of around 70 milliseconds in low-priority RT processes
when running a "dd if=/dev/hda of=/dev/null" in parallel (where hda
is a CF card) is due to readahead.

Two indications for that:
* Per default, maximum readahead is 128 KB. 70 ms is exactly the time
needed to transfer 128 KB 
(our CF cards have a sustained transfer rate of 1800 KB/sec).
* If the readahead constants in the kernel are changed,
the observed latencies scale almost linearly.

So obviously:
* The PIO mode IDE transfers keep the CPU 100 % busy.
* No other processes get scheduled between the data transfer of
individual "sectors", i.e. there are no holes between the IDE 
interrupts.

However, there is no need to change the readahead mechanism,
because even the transfer of a single sector would exceed our
latency requirements. So we either need to switch to DMA (which we
can't in the short term), or run the time-critical tasks above IDE 
priority. 

So the question is, what exactly is the IDE priority?
Is the PIO transfer done in the IRQ handler or in a bh?

-- 
Klaus Kusche                 (Software Development - Control Systems)
KEBA AG             Gewerbepark Urfahr, A-4041 Linz, Austria (Europe)
Tel: +43 / 732 / 7090-3120                 Fax: +43 / 732 / 7090-6301
E-Mail: kus@keba.com                                WWW: www.keba.com

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

* Re: RT 45-01: CF Card read: High latency?
  2005-04-11 11:38 RT 45-01: CF Card read: High latency? kus Kusche Klaus
@ 2005-04-11 11:56 ` Bartlomiej Zolnierkiewicz
  2005-04-11 13:00 ` P
  1 sibling, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-04-11 11:56 UTC (permalink / raw)
  To: kus Kusche Klaus; +Cc: Ingo Molnar, linux-kernel

On Apr 11, 2005 1:38 PM, kus Kusche Klaus <kus@keba.com> wrote:

> So the question is, what exactly is the IDE priority?
> Is the PIO transfer done in the IRQ handler or in a bh?

in the IRQ handler

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

* Re: RT 45-01: CF Card read: High latency?
  2005-04-11 11:38 RT 45-01: CF Card read: High latency? kus Kusche Klaus
  2005-04-11 11:56 ` Bartlomiej Zolnierkiewicz
@ 2005-04-11 13:00 ` P
  1 sibling, 0 replies; 3+ messages in thread
From: P @ 2005-04-11 13:00 UTC (permalink / raw)
  To: kus Kusche Klaus; +Cc: Ingo Molnar, linux-kernel

I handled this issue by precaching all my files (15MB),
from my readonly root filesystem.

find / -type f |
grep -v ^/boot | #kernel is > 1MB and never read so don't put in cache
while read file; do
     dd bs=32k if="$file" of=/dev/null 2>/dev/null
done

Pádraig.

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

end of thread, other threads:[~2005-04-11 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-11 11:38 RT 45-01: CF Card read: High latency? kus Kusche Klaus
2005-04-11 11:56 ` Bartlomiej Zolnierkiewicz
2005-04-11 13:00 ` P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).