public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Stanislav Meduna <stano@meduna.org>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: loading pages to memory causes high latency
Date: Sat, 27 Oct 2012 10:38:17 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1210271029370.2756@ionos> (raw)
In-Reply-To: <alpine.LFD.2.02.1210262254560.2756@ionos>

On Fri, 26 Oct 2012, Thomas Gleixner wrote:
> On Fri, 26 Oct 2012, Stanislav Meduna wrote:
> > The command
> >   echo 1000000 > /proc/sys/kernel/sched_rt_runtime_us
> > fixes the problem but is not really something I want
> > to enable when developing a real-time capable system
> > that will be running in remote locations. With 980000
> > I still get negligible latencies. With 970000 I get 4 ms.
> > With 960000 I get 15 ms latencies. So it is indeed
> > the throttling that is firing here.
> 
> Right. So that means that the pata irq or something else loops in
> circles for whatever reasons.
> 
> For a simple test, can you just set the pata irq thread to SCHED_OTHER
> with chrt? Does that cure the problem?
> 
> Aside of that I'd really like to see a full function trace of that
> scenario. Can you please apply the patch below and run that with the
> function tracer enabled. The throttling will stop the trace right at
> the point.

Ok. The trace shows what happens. The pata driver runs all of its work
in the interrupt handler context and the hardware is fast enough to
saturate the machine. I.e. right after the handler returns and
reenables interrupts the next pata irq fires. Lather rinse and repeat.

On mainline you'd just see the machine stalling for a bit as it would
process interrupts and nothing else. Of course you wont see rt
throttling because all of this happens in hard interrupt context,
except if you force interrupt threading via "threadirqs" on the kernel
command line.

There is not much we can do about that unless we want to do a major
surgery on that pata driver code.

So either you disable the throttler or you reconfigure the pata irq
thread to SCHED_OTHER, which will slow it down a bit, but avoids the
hogging of the machine with a RT task going wild.

Thanks,

	tglx

  reply	other threads:[~2012-10-27  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 18:00 loading pages to memory causes high latency Stanislav Meduna
2012-10-26 21:04 ` Thomas Gleixner
2012-10-27  8:38   ` Thomas Gleixner [this message]
2012-10-27  9:06     ` Stanislav Meduna
2012-10-27  9:56       ` Thomas Gleixner

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=alpine.LFD.2.02.1210271029370.2756@ionos \
    --to=tglx@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stano@meduna.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox