From: Stephan.Zeisset@intel.com
To: linux-ia64@vger.kernel.org
Subject: RE: [Linux-ia64] HZ and PROC_CHANGE_PENALTY
Date: Thu, 19 Oct 2000 21:01:53 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590678205600@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205599@msgid-missing>
Interesting observation.
I have seen threads jumping cpus without need on a 2.4.0-test8 kernel and this might explain.
Stephan.
-----Original Message-----
From: Jun Nakajima [mailto:jun@sco.com]
Sent: Thursday, October 19, 2000 1:56 PM
To: linux-ia64@linuxia64.org
Subject: [Linux-ia64] HZ and PROC_CHANGE_PENALTY
I think we have may CPU affinity issues.
At this point we are using
#define HZ 1024
#define PROC_CHANGE_PENALTY 20
IA-32 uses:
#define HZ 100
#define PROC_CHANGE_PENALTY 15
When a process is created, p->counter is set to
#define DEF_COUNTER (10*HZ/100) /* 100 ms time slice */
And basically p->counter is decremented by update_process_times(), to
implement the time-sharing scheduling (i.e. SCHED_OTHER). Now schedule()
calls goodness() to compute goodness for every process on the runqueue,
to pick up a process with the max goodness.
The function goodness() computes goodness using p->counter (for
SCHED_OTHER):
if (p->policy = SCHED_OTHER) {
/*
* Give the process a first-approximation goodness value
* according to the number of clock-ticks it has left.
*
* Don't do any other calculations if the time slice is
* over..
*/
weight = p->counter;
if (!weight)
goto out;
#ifdef CONFIG_SMP
/* Give a largish advantage to the same processor... */
/* (this is equivalent to penalizing other processors) */
if (p->processor = this_cpu)
weight += PROC_CHANGE_PENALTY;
#endif
/* .. and a slight advantage to the current MM */
if (p->mm = this_mm || !p->mm)
weight += 1;
weight += 20 - p->nice;
goto out;
}
The bottom line is that in general processes on IA-64 Linux would have
much larger p->counter (10 times larger, compared to IA-32 or other
architectures), PROC_CHANGE_PENALTY should be large enough to provide
that kind of soft CPU affinity (I'm not sure the difference '5' was
intended for that). In addition the contributions from other factors
(p->nice and p->mm) are much less effective at this point.
Am I missing something?
Thanks,
--
Jun U Nakajima
Core OS Development
SCO/Murray Hill, NJ
Email: jun@sco.com, Phone: 908-790-2352 Fax: 908-790-2426
_______________________________________________
Linux-IA64 mailing list
Linux-IA64@linuxia64.org
http://lists.linuxia64.org/lists/listinfo/linux-ia64
next prev parent reply other threads:[~2000-10-19 21:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-19 20:56 [Linux-ia64] HZ and PROC_CHANGE_PENALTY Jun Nakajima
2000-10-19 21:01 ` Stephan.Zeisset [this message]
2000-10-19 23:00 ` Jun Nakajima
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=marc-linux-ia64-105590678205600@msgid-missing \
--to=stephan.zeisset@intel.com \
--cc=linux-ia64@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