From: george anzinger <george@mvista.com>
To: Mike Galbraith <mikeg@wen-online.de>
Cc: Nigel Gamble <nigel@nrg.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: #define HZ 1024 -- negative effects?
Date: Sun, 29 Apr 2001 01:46:47 -0700 [thread overview]
Message-ID: <3AEBD4F7.D5B2517F@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0104280646140.430-100000@mikeg.weiden.de>
Mike Galbraith wrote:
>
> On Fri, 27 Apr 2001, Nigel Gamble wrote:
>
> > On Fri, 27 Apr 2001, Mike Galbraith wrote:
> > > On Fri, 27 Apr 2001, Nigel Gamble wrote:
> > > > > What about SCHED_YIELD and allocating during vm stress times?
> > >
> > > snip
> > >
> > > > A well-written GUI should not be using SCHED_YIELD. If it is
> > >
> > > I was refering to the gui (or other tasks) allocating memory during
> > > vm stress periods, and running into the yield in __alloc_pages()..
> > > not a voluntary yield.
> >
> > Oh, I see. Well, if this were causing the problem, then running the GUI
> > at a real-time priority would be a better solution than increasing the
> > clock frequency, since SCHED_YIELD has no effect on real-time tasks
> > unless there are other runnable real-time tasks at the same priority.
> > The call to schedule() would just reschedule the real-time GUI task
> > itself immediately.
> >
> > However, in times of vm stress it is more likely that GUI performance
> > problems would be caused by parts of the GUI having been paged out,
> > rather than by anything which could be helped by scheduling differences.
>
> Agreed. I wasn't thinking about swapping, only kswapd not quite keeping
> up with laundering, and then user tasks having to pick up some of the
> load. Anyway, I've been told that for most values of HZ the slice is
> 50ms, so my reasoning wrt HZ/SCHED_YIELD was wrong. (begs the question
> why do some archs use higher HZ values?)
>
Well, almost. Here is the scaling code:
#if HZ < 200
#define TICK_SCALE(x) ((x) >> 2)
#elif HZ < 400
#define TICK_SCALE(x) ((x) >> 1)
#elif HZ < 800
#define TICK_SCALE(x) (x)
#elif HZ < 1600
#define TICK_SCALE(x) ((x) << 1)
#else
#define TICK_SCALE(x) ((x) << 2)
#endif
#define NICE_TO_TICKS(nice) (TICK_SCALE(20-(nice))+1)
This, by the way, is new with 2.4.x. As to why, it has more to do with
timer resolution than anything else. Timer resolution is 1/HZ so higher
HZ => better resolution. Of course, you must pay for it. Nothing is
free :) Higher HZ means more interrupts => higher overhead.
George
next prev parent reply other threads:[~2001-04-29 8:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-26 18:19 #define HZ 1024 -- negative effects? Adam J. Richter
2001-04-26 18:31 ` Rik van Riel
2001-04-26 20:24 ` Dan Mann
2001-04-27 10:04 ` Mike Galbraith
2001-04-27 15:06 ` Dan Mann
2001-04-27 19:26 ` Nigel Gamble
2001-04-27 20:28 ` Mike Galbraith
2001-04-27 23:22 ` Nigel Gamble
2001-04-28 4:57 ` Mike Galbraith
2001-04-29 8:46 ` george anzinger [this message]
[not found] <fa.gh4u8sv.17i1q6@ifi.uio.no>
2001-04-26 2:02 ` Dan Maas
2001-04-26 2:30 ` Werner Puschitz
2001-04-26 3:51 ` Mike Galbraith
2001-04-28 8:23 ` Guus Sliepen
-- strict thread matches above, loose matches on Subject: below --
2001-04-24 23:20 Michael Rothwell
2001-04-25 22:40 ` Nigel Gamble
2001-04-29 21:44 ` Jim Gettys
2001-04-29 21:59 ` Michael Rothwell
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=3AEBD4F7.D5B2517F@mvista.com \
--to=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikeg@wen-online.de \
--cc=nigel@nrg.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.