From: Bill Davidsen <davidsen@tmr.com>
To: Stephen Warren <SWarren@nvidia.com>
Cc: Con Kolivas <kernel@kolivas.org>, linux-kernel@vger.kernel.org
Subject: Re: SCHED_RR and kernel threads
Date: Wed, 10 Nov 2004 14:28:45 -0500 [thread overview]
Message-ID: <41926BED.7040400@tmr.com> (raw)
In-Reply-To: <DBFABB80F7FD3143A911F9E6CFD477B002A7F144@hqemmail02.nvidia.com>
Stephen Warren wrote:
>>From: Con Kolivas [mailto:kernel@kolivas.org]
>>Stephen Warren writes:
>>
>>>I guess we could have most threads stay at SCHED_NORMAL, and just
>
> make
>
>>>the few critical threads SCHED_RR, but I'm getting a lot of push-back
>
> on
>
>>>this, since it makes our thread API a lot more complex.
>>
>>Your workaround is not suitable for the kernel at large.
>
>
> You mean the official kernel.org kernel? I wasn't implying that the
> patch should be part of that!
>
> In our system we have literally EVERY single thread (kernel, user-space
> daemons, and user-space applications) all setup as SCHED_RR with
> identical priority at present, except a couple higher priority threads.
> We did this initially for user-space by replacing /sbin/init with a
> wrapper that set the scheduler policy and default priority, and verified
> that this was inherited by all daemons & application threads. Then, we
> found that the kernel threads could get starved in some situations,
> hence the kernel change.
>
> Our threading model dictates that every thread have a priority (so that
> the thread model is portable between Linux, embedded RTOSs etc.), and in
> Linux AFAIK, the only way to implement priorities is to use a real-time
> scheduling policy. Some threads do a lot of calculation. We want to make
> them equal (or probably, lower) priority to the kernel threads, so
> therefore the kernel threads must then be SCHED_RR.
>
> Can you elaborate on specific conditions that would cause the kernel
> threads to suck up unusual amounts of CPU time?
>
> In our application, keyboard processing is a real-time requirement, so
> if that is performed in a kernel thread, that kernel thread should be
> real-time. We basically want the control to insert e.g. the keyboard
> processing kernel thread into the middle of our priority hierarchy,
> rather than having it forced as the lowest possible priority.
Perhaps someone could comment on why the keyboard thread is NOT higher
priority? The whole functionality of SysReq key combinations would seem
to depend on actually seeing the strokes. I would cautiously suggest
that a priority control in /proc/sys might be a useful interface,
certainly compared to patching the kernel and rebuilding.
Yes, I mean an option in the mainline kernel, so when debugging hangs
the keyboard could be used.
--
-bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me
next prev parent reply other threads:[~2004-11-10 20:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-09 1:56 SCHED_RR and kernel threads Stephen Warren
2004-11-09 2:22 ` Con Kolivas
2004-11-10 19:28 ` Bill Davidsen [this message]
2004-11-10 20:40 ` Con Kolivas
-- strict thread matches above, loose matches on Subject: below --
2004-11-08 20:50 Stephen Warren
2004-11-09 1:08 ` Con Kolivas
2004-11-08 18:30 Stephen Warren
2004-11-08 20:29 ` Con Kolivas
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=41926BED.7040400@tmr.com \
--to=davidsen@tmr.com \
--cc=SWarren@nvidia.com \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.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 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.