Re: RSDL v0.31

From: Ingo Molnar
Date: Sat Mar 17 2007 - 11:40:43 EST



* Rik van Riel <riel@xxxxxxxxxx> wrote:

> The increased AIM7 throughput (and the other benchmark results) looked
> very promising to me.
>
> I wonder what we're doing wrong in the normal scheduler...

there's a relatively easy way to figure out whether it's related to the
interactivity code: try AIM7 with SCHED_BATCH as well, to take most of
the 'interactivity effects' out of the picture.

build the attached setbatch.c code and do "./setbatch $$" to change the
shell to SCHED_BATCH (and all its future children will be SCHED_BATCH
too).

Ingo

/*
* Set a given PID to be a SCHED_BATCH process.
*
* Copyright (C) 2002 Ingo Molnar
*/
#include <time.h>
#include <stdio.h>
#include <sched.h>
#include <stdlib.h>
#include <sys/types.h>
#include <linux/unistd.h>

int main (int argc, char **argv)
{
int pid, ret;
struct sched_param p;

p.sched_priority = 0;

if (argc != 2) {
printf("usage: setbatch <pid>\n");
exit(-1);
}
pid = atol(argv[1]);

ret = sched_setscheduler(pid, 3, &p);

if (ret) {
printf("could not set pid %d to SCHED_BATCH: err %d.\n", pid, ret);
return -1;
}
printf("pid %d is SCHED_BATCH from now on.\n", pid);
return 0;
}