mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Shawn Bohrer <shawn.bohrer@gmail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: High scheduler wake up times
Date: Sat, 30 Jan 2010 16:02:42 -0800	[thread overview]
Message-ID: <20100130160242.6532fa81@infradead.org> (raw)
In-Reply-To: <20100130234551.GA27390@mediacenter.gateway.2wire.net>

On Sat, 30 Jan 2010 17:45:51 -0600
Shawn Bohrer <shawn.bohrer@gmail.com> 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?


  parent reply	other threads:[~2010-01-31  0:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30 23:45 Shawn Bohrer
2010-01-30 23:56 ` Arjan van de Ven
2010-01-31  0:29   ` Shawn Bohrer
2010-01-31  0:02 ` Arjan van de Ven [this message]
2010-01-31  0:11 ` Arjan van de Ven
2010-01-31  0:35   ` Shawn Bohrer
2010-01-31  0:46     ` Shawn Bohrer
2010-01-31  0:47     ` Arjan van de Ven
2010-01-31  3:47       ` Shawn Bohrer
2010-01-31 18:28         ` Arjan van de Ven
2010-01-31 20:50           ` Shawn Bohrer
2010-02-01  8:51       ` Peter Zijlstra
2010-02-01 19:37         ` Shawn Bohrer

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=20100130160242.6532fa81@infradead.org \
    --to=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=shawn.bohrer@gmail.com \
    /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

Powered by JetHome