Re: [PATCH *] scheduler bigpatch (test results)

Kurt Garloff (garloff@kg1.ping.de)
Wed, 21 Oct 1998 16:50:30 +0200


--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii

On Tue, Oct 20, 1998 at 09:42:57PM +0200, Rik van Riel wrote:
> Hi,
>
> I have received a few reports from people who applied the
> scheduler bigpatch to their kernel and are running with it.
>
> They have reported increased interactive performance and
> a still stable system. I guess this means that my patch
> works and is safe to test for everybody...

Did anybody test it with rc5des? I did and I'm absolutely unhappy with it.

What do I expect?

Normally rc5des gets about 5% of the computing power if one unniced process
is competing for CPU. With your idle patch, I expect it to get 0% unless any
non-idle process goes to sleep.
0 500 273 1 19 19 836 344 startup_32 S N ? 0:00 ./rc5des
40 500 274 273 19 19 836 344 startup_32 S N ? 0:00 ./rc5des
40 500 275 274 19 19 836 344 R N ? 5:40 ./rc5des
This is rc5des416-linux-x86-mt. MT meaning multithreaded (on my UP machine...)

What happens?

I use the appended idle program to either set a started rc5des to idle
priority or to start it with idle priority. (Makes no difference, except the
two sleeping rc5des processes are also idle policy when starting it.)
0 500 273 1 19 19 836 344 R N ? 0:00 ./rc5des
40 500 274 273 20 19 836 344 R N ? 0:00 ./rc5des
40 500 275 274 0 0 836 344 R ? 30:04 ./rc5des
(Why are pids 273 and 274 not in S state (sleeping) any longer? They don't
get any CPU, though.)
I run another program with an idle rc5des, it gets 100% of the CPU, i.e.
rc5des gets nothing. Interactive performance is fine in this situation.

If no other program competes with the idle rc5des, interactive performance
is very very bad. After typing a character at the bash, it takes one second
for it to appear!

Whenever an "idle" task is on the top of the runqueue, it takes quite some
time to have it removed and have an "other" task waked.
(I think, it's because its on the fifo queue and we don't recalculate
priorities very often then.)

So, the idle policy is either meant to act like that (unlikely, because most
peolpe wanting to have it, want to use rc5des or cracker) or something is
wrong with it.
If the first is true, we still need some implementation of very nice, like
getting 0.05% of CPU against a nice 0 process instead of 5%. The advantage
is having it react to kill -15 (even if an other process is running) after
some time.

-- 
Kurt Garloff <K.Garloff@ping.de>  (Dortmund, FRG)
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff
Unix IS user friendly - it's just selective about who its friends are!

--5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Description: idle.c Content-Disposition: attachment; filename="idle.c"

/* idle.c */ /* * adjusts priority of a process to IDLE */

#include <stdio.h> #include <stddef.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/resource.h>

#if defined _POSIX_PRIORITY_SCHEDULING # include <sched.h> #endif #ifndef SCHED_IDLE # define SCHED_IDLE 3 #endif

int main (int argc, char** argv) { char* prg = 0; pid_t pid = getpid (); //uid_t uid = getuid (); if (argc <= 1) { fprintf (stderr, "Usage: idle pid or idle prog args\n"); exit (1); } if (isdigit (argv[1][0])) pid = atol (argv[1]); else prg = argv[1]; #if defined _POSIX_PRIORITY_SCHEDULING { struct sched_param sched_parms; sched_parms.sched_priority = 0;

printf ("idle: setting scheduling policy on pid %i to idle (%i).\n", pid, sched_parms.sched_priority); if (0 != sched_setscheduler (pid, SCHED_IDLE, &sched_parms)) perror ("idle: cannot set idle scheduling policy"); }; #else fprintf (stderr, "idle: scheduling policies not supported\n"); exit (2); #endif //setuid (uid); if (prg) return execv (prg, ++argv); };

--5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Description: unidle.c Content-Disposition: attachment; filename="unidle.c"

/* unidle.c */ /* * adjusts priority of a process to OTHER */

#include <stdio.h> #include <stddef.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/resource.h>

#if defined _POSIX_PRIORITY_SCHEDULING # include <sched.h> #endif #ifndef SCHED_IDLE # define SCHED_IDLE 3 #endif

int main (int argc, char** argv) { char* prg = 0; pid_t pid = getpid (); //uid_t uid = getuid (); if (argc <= 1) { fprintf (stderr, "Usage: unidle pid or unidle prog args\n"); exit (1); } if (isdigit (argv[1][0])) pid = atol (argv[1]); else prg = argv[1]; #if defined _POSIX_PRIORITY_SCHEDULING { struct sched_param sched_parms; int poli; poli = sched_getscheduler (pid); printf ("unidle: scheduling policy of pid %i: %i\n", pid, poli); if (poli != SCHED_IDLE) exit(3); sched_parms.sched_priority = 0; printf ("unidle: setting scheduling policy on pid %i to other (%i).\n", pid, sched_parms.sched_priority); if (0 != sched_setscheduler (pid, SCHED_OTHER, &sched_parms)) perror ("unidle: cannot set other scheduling policy"); }; #else fprintf (stderr, "unidle: scheduling policies not supported\n"); exit (2); #endif //setuid (uid); if (prg) return execv (prg, ++argv); };

--5vNYLRcllDrimb99--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/