From: Andrea Arcangeli <andrea@suse.de>
To: David Schwartz <davids@webmaster.com>
Cc: dak@gnu.org, linux-kernel@vger.kernel.org
Subject: Re: Scheduling problem with 2.4?
Date: Sun, 18 May 2003 03:06:21 +0200 [thread overview]
Message-ID: <20030518010621.GC1429@dualathlon.random> (raw)
In-Reply-To: <MDEHLPKNGKAHNMBLJOLKIELBDAAA.davids@webmaster.com>
On Sat, May 17, 2003 at 05:16:33PM -0700, David Schwartz wrote:
>
> > I see what you mean, but I still don't think it is a problem. If
> > bandwidth matters you will have to use large writes and reads anyways,
> > if bandwidth doesn't matter the number of ctx switches doesn't matter
> > either and latency usually is way more important with small messages.
>
> > Andrea
>
> This is the danger of pre-emption based upon dynamic priorities. You can
> get cases where two processes each are permitted to make a very small amount
> of progress in alternation. This can happen just as well with large writes
> as small ones, the amount of data is irrelevent, it's the amount of CPU time
> that's important, or to put it another way, it's how far a process can get
> without suffering a context switch.
>
> I suggest that a process be permitted to use up at least some portion of
> its timeslice exempt from any pre-emption based solely on dynamic
> priorities.
that's the issue yes. but then when a multithreaded app sends a signal
to another process it can take up to this "x" timeslice portion before
the signal will run (I mean in UP). Same goes for mouse clicks etc..
1msec for mouse clicks should not be noticeable though. And over all I
don't see a real big issue in the current code.
To try it probably the simpler way to add a need_resched_timeout
along to need_resched, and to honour the need_resched only when the
timeout triggers, immediate need_resched will set the timeout = jiffies
so it'll trigger immediatly, the timer interrupt will check it. The
reschedule_idle on a non idle cpu will be the only one to set the
timeout. Effectively I'm curious to see what will happen. Not all archs
would need to check against it (the entry.S code is the main reader of
need_resched), it'll be an hint only and idle() for sure must not check
it at all. this would guarantee minimal timeslice reserved up to 1/HZ by
setting the timeout to jiffies + 2 (jiffies + 1 would return a mean of
1/HZ/2 but the worst case would be ~0, in practice even + 1 would be
enough) Does anybody think this could have a value? If yes I can make a
quick hack to see what happens.
Andrea
next prev parent reply other threads:[~2003-05-18 0:53 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-17 11:22 Scheduling problem with 2.4? David Kastrup
2003-05-17 17:41 ` Andrea Arcangeli
2003-05-17 19:36 ` David Kastrup
2003-05-17 20:30 ` Andrea Arcangeli
2003-05-17 20:44 ` David Kastrup
2003-05-17 21:53 ` Andrea Arcangeli
2003-05-17 22:37 ` David Kastrup
2003-05-17 23:50 ` Andrea Arcangeli
2003-05-18 0:16 ` David Schwartz
2003-05-18 1:06 ` Andrea Arcangeli [this message]
2003-05-18 9:41 ` David Kastrup
2003-05-18 8:55 ` Mike Galbraith
2003-05-18 17:46 ` David Schwartz
2003-05-18 23:18 ` Andrea Arcangeli
2003-05-19 2:59 ` David Schwartz
2003-05-18 23:11 ` Andrea Arcangeli
2003-05-19 7:16 ` Mike Galbraith
2003-05-19 4:02 ` Mike Galbraith
2003-05-18 0:24 ` David Kastrup
2003-05-17 21:54 ` Barry K. Nathan
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=20030518010621.GC1429@dualathlon.random \
--to=andrea@suse.de \
--cc=dak@gnu.org \
--cc=davids@webmaster.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox