Interrupt load with niced processes

Matthew Dillon dillon at apollo.backplane.com
Thu Jun 7 10:45:14 PDT 2007


    Ok, they aren't real interrupts... its actually system load.  I
    wrote a quick program to lock the shell down onto a particular
    cpu.

    I tried running both tests (with and without echo exec'd) on both
    cpu and cpu 1 and this is what I got on a 2-cpu system:

    echo
    exec'd?	cpu	sys intr user nice idle

    yes		0	20  20   10   0    50
    yes		1	40   0   10   0    50
    no		0	30   0   20   0    50
    no		1	30   0   20   0    50

    I get about the same fork rate whether on cpu 0 or 1, and also about
    the same IPI rate.  There shouldn't be so many ipi's with everything
    locked down on one cpu but I'm guessing they are just scheduler wakeups
    because the scheduler code isn't optimizing for processes locked down
    on particular cpu's.  I'll track it down.

    Clearly the interrupt statistics are being miscalculated... its really
    system time, not interrupt time.

						-Matt

#include <sys/types.h>
#include <sys/usched.h>

int
main(int ac, char **av)
{
    int cpu;

    if (ac == 1) {
        printf("specify cpu please!\n");
        exit(1);
    }
    cpu = strtol(av[1], NULL, 0);

    if (usched_set(0, USCHED_SET_CPU, &cpu, sizeof(cpu)) < 0)
        perror("usched_set");
    else
        system("/bin/sh");
    return(0);
}






More information about the Kernel mailing list