[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1101261001550.14705@localhost6.localdomain6>
Date: Wed, 26 Jan 2011 10:06:28 -0800 (PST)
From: Davide Libenzi <davidel@...ilserver.org>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Shawn Bohrer <shawn.bohrer@...il.com>,
Simon Kirby <sim@...tway.ca>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: sys_epoll_wait high CPU load in 2.6.37
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists