Re: High scheduler wake up times

From: Arjan van de Ven
Date: Sat Jan 30 2010 - 19:02:05 EST


On Sat, 30 Jan 2010 17:45:51 -0600
Shawn Bohrer <shawn.bohrer@xxxxxxxxx> wrote:
>
> int main ()
> {
> int epfd = epoll_create(1);
> int i, j;
> struct timeval tv;
> unsigned long start, end;
> const unsigned int count = 60000;
>
> while (1) {
> gettimeofday(&tv, NULL);
> start = tv.tv_sec * 1000000 + tv.tv_usec;
>
> for (i = 0; i < count; ++i) {
> if (epoll_wait(epfd, 0, 1, 1) == -1)
> perror("epoll failed");
>
> for (j = 0; j < 10000; ++j)
> /* simulate work */;
> }
> gettimeofday(&tv, NULL);
> end = tv.tv_sec * 1000000 + tv.tv_usec;
>
> printf("Iterations Per Sec: %f\n",
> count/((double)(end - start)/1000000)); }
>
> close(epfd);
> }

btw do you have an equivalent program that uses poll instead of epoll
by chance?

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