From: Jamie Lokier <jamie@shareable.org>
To: Bill Gatliff <bgat@billgatliff.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
sen wang <wangsen.linux@gmail.com>,
mingo@elte.hu, akpm@linux-foundation.org, kernel@kolivas.org,
npiggin@suse.de, arjan@infradead.org,
linux-arm-kernel@lists.arm.linux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: report a bug about sched_rt
Date: Sun, 26 Jul 2009 20:03:43 +0100 [thread overview]
Message-ID: <20090726190343.GB12916@shareable.org> (raw)
In-Reply-To: <4A6BC2FC.7020700@billgatliff.com>
Bill Gatliff wrote:
> Jamie Lokier wrote:
> >I agree with communicting the desire explicitly to the scheduler.
> >
> >In the above example, the exact desire is "give me as much CPU as I
> >ask for, because my hardware servicing will be adversely but
> >non-fatally affected if you don't, and the amount of CPU needed to
> >service the hardware cannot be determined in advance, but prevent me
> >from blocking progress in the rest of the system by limiting my
> >exclusive ownership of the CPU".
> >
> >How do you propose to communicate that to the scheduler, if not by
> >something rather like RT-bandwidth with downgrading to SCHED_OTHER
> >when a policy limit is exceeded?
>
> This is a great real-world problem. And there's no one-size-fits-all
> answer, unfortunately.
>
> RT-bandwidth will give you the system behavior you are after, but it's a
> pretty blunt instrument.
I'm under the impression that RT-bandwidth will *not* give the above
system behaviour, and that is the whole reason for this thread.
> I'd consider putting some throttling in your interrupt handler that
> prevents it from running more than a certain amount of calculation per
> interrupt event.
There is no interrupt handler in my specification above...
> And perhaps it's looking at execution timestamps to
> determine how often it's running, and can therefore do a rough
> calculation of how much CPU it's eating. At least until threaded
> interrupt scheduling is widespread, a runaway interrupt handler is
> definitely an opportunity to hang up a system.
With threaded interrupt scheduling using RT priority, that opportunity
to hang the system is exactly the same.
Indeed, threaded interrupts are a good example of when you might want
a limit fraction of the CPU allocated to that thread at RT priority,
falling down to SCHED_OTHER if the handler needs to continue to run.
That is, in fact, how
> Tasklets
tasklets, bottom halves and things like that work :-)
[snip explanation of tasklets]
> That's often a decent way to deal with system overload, especially if it
> leaves the system functional enough to take some sort of "evasive
> action" like reverting to polled i/o, issuing a diagnostic message, or
> doing an orderly transition to a safe mode.
Polled I/O is good when this happens. You can revert to polled I/O
automatically without coding it explicitly in interrupt handlers, if
the scheduler provides appropriate support.
When a threaded interrupt (with RT priority, naturally) is run too
often, then you stop scheduling it as RT and bring it down to
SCHED_OTHER or lower, periodically allowing it to have a fair share of
the CPU when there are other runnable tasks. That's quite close to
polling I/O, without coding it explicitly in the device driver.
So RT-bandwidth would be nice for those threaded interrupts.
-- Jamie
next prev parent reply other threads:[~2009-07-26 19:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 10:57 report a bug about sched_rt sen wang
2009-07-24 12:14 ` Peter Zijlstra
2009-07-24 13:04 ` sen wang
2009-07-24 13:14 ` Peter Zijlstra
2009-07-24 13:26 ` sen wang
2009-07-24 13:33 ` Peter Zijlstra
2009-07-24 13:44 ` sen wang
2009-07-24 13:54 ` Peter Zijlstra
2009-07-24 14:04 ` sen wang
2009-07-24 14:48 ` Peter Zijlstra
2009-07-24 14:53 ` sen wang
2009-07-24 15:07 ` sen wang
2009-07-24 15:24 ` Peter Zijlstra
2009-07-24 15:43 ` sen wang
2009-07-24 15:34 ` Thomas Gleixner
2009-07-25 11:12 ` Raistlin
2009-07-24 14:24 ` sen wang
2009-07-24 14:48 ` Peter Zijlstra
2009-07-24 15:02 ` sen wang
2009-07-24 15:40 ` Jamie Lokier
2009-07-24 16:01 ` Peter Zijlstra
2009-07-24 23:30 ` Jamie Lokier
2009-07-25 5:22 ` Bill Gatliff
2009-07-25 22:48 ` Jamie Lokier
2009-07-26 2:44 ` Bill Gatliff
2009-07-26 19:03 ` Jamie Lokier [this message]
2009-07-27 10:45 ` Peter Zijlstra
2009-07-27 13:35 ` Bill Gatliff
2009-07-25 12:33 ` Raistlin
2009-07-25 14:58 ` Tommaso Cucinotta
2009-07-25 12:19 ` Raistlin
2009-07-25 22:54 ` Jamie Lokier
2009-07-25 23:24 ` Tommaso Cucinotta
2009-07-25 11:10 ` Raistlin
[not found] ` <454c71700907250429i1c77658bt6d65b02f08a29f4a@mail.gmail.com>
2009-07-25 23:01 ` Jamie Lokier
2009-07-24 14:28 ` Arjan van de Ven
2009-07-26 3:55 ` sen wang
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=20090726190343.GB12916@shareable.org \
--to=jamie@shareable.org \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=bgat@billgatliff.com \
--cc=kernel@kolivas.org \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=peterz@infradead.org \
--cc=wangsen.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox