All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Shawn Bohrer <shawn.bohrer@gmail.com>,
	Simon Kirby <sim@hostway.ca>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: sys_epoll_wait high CPU load in 2.6.37
Date: Wed, 26 Jan 2011 10:06:28 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1101261001550.14705@localhost6.localdomain6> (raw)
In-Reply-To: <1296064311.2899.90.camel@edumazet-laptop>

On Wed, 26 Jan 2011, Eric Dumazet wrote:

> > > --- a/fs/eventpoll.c
> > > +++ b/fs/eventpoll.c
> > > @@ -1125,8 +1125,8 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
> > >  	ktime_t expires, *to = NULL;
> > >  
> > >  	if (timeout > 0) {
> > > -		ktime_get_ts(&end_time);
> > > -		timespec_add_ns(&end_time, (u64)timeout * NSEC_PER_MSEC);
> > > +		poll_select_set_timeout(&end_time, timeout / MSEC_PER_SEC,
> > > +				NSEC_PER_MSEC * (timeout % MSEC_PER_SEC));
> > >  		slack = select_estimate_accuracy(&end_time);
> > >  		to = &expires;
> > >  		*to = timespec_to_ktime(end_time);
> > 
> > poll_select_set_timeout() jumps through some extra hoops that
> > aren't necessary in the epoll case so I actually like your previous
> > patch better.
> 
> Well, I dont care, I let Davide decide, he is the boss ;)
> 
> This is a stable candidate, so adding timespec_add_ms() sounds overkill.

Eric, if you look at fs/select.c (~line 925), poll does exactly the same 
thing as epoll do.
It too, ignores the eventual return value of poll_select_set_timeout(), so 
maybe a little bit more optimized ktime_get_ts+timespec_add_ms could make 
sense.


- Davide



  reply	other threads:[~2011-01-26 18:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26  0:09 sys_epoll_wait high CPU load in 2.6.37 Simon Kirby
2011-01-26  7:18 ` Eric Dumazet
2011-01-26 11:16   ` Eric Dumazet
2011-01-26 15:31     ` Davide Libenzi
2011-01-26 15:43       ` Eric Dumazet
2011-01-26 15:52         ` Davide Libenzi
2011-01-26 15:59           ` Eric Dumazet
2011-01-26 16:13             ` Eric Dumazet
2011-01-26 17:20               ` Shawn Bohrer
2011-01-26 17:51                 ` Eric Dumazet
2011-01-26 18:06                   ` Davide Libenzi [this message]
2011-01-26 18:18                     ` Eric Dumazet
2011-01-26 18:45                       ` Eric Dumazet
2011-01-28  0:17                         ` Davide Libenzi

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=alpine.DEB.2.00.1101261001550.14705@localhost6.localdomain6 \
    --to=davidel@xmailserver.org \
    --cc=akpm@linux-foundation.org \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawn.bohrer@gmail.com \
    --cc=sim@hostway.ca \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.