public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Ray Lee" <ray-lk@madrabbit.org>
Cc: "Arjan van de Ven" <arjan@infradead.org>,
	"Marcin Slusarz" <marcin.slusarz@gmail.com>,
	"Carlos R. Mafra" <crmafra2@gmail.com>,
	"Arjan van de Ven" <arjan@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [2.6.28-rc1 regression] wmifinfo dockapp takes 100% of cpu (bisected)
Date: Thu, 30 Oct 2008 00:04:42 -0700	[thread overview]
Message-ID: <20081030000442.fdc831c1.akpm@linux-foundation.org> (raw)
In-Reply-To: <2c0942db0810251238u7eae212ct76af5c6d05126260@mail.gmail.com>

On Sat, 25 Oct 2008 12:38:22 -0700 "Ray Lee" <ray-lk@madrabbit.org> wrote:

> On Sat, Oct 25, 2008 at 12:12 PM, Arjan van de Ven <arjan@infradead.org> wrote:
> > On Sat, 25 Oct 2008 20:03:27 +0200
> > Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
> >> > >           if (copy_from_user(&tv, tvp, sizeof(tv)))
> >> > >                   return -EFAULT;
> >> > >
> >> > > +         while (tv.tv_usec > USEC_PER_SEC && i < 1000) {
> >>                                   ^
> >> should be >=
> >
> > yeah thanks for catching that. Note to self: don't code before coffee
> >
> > I'm not very happy with a while loop; but at least it solves the problem
> >
> > I'll try to make it nicer than this ...
> 
> Regardless, you may wish to make a set_normalized_timeval and place it
> in kernel/time.c right after the current set_nromalized_timespec.

Yes, this comes up fairly regularly and we would benefit from having a
normalize-a-timeval library function.

I don't think it should be implemented via a while loop though.  That's
acceptable with timespecs, which can only loop four or so times.  But
timevals use microseconds and can loop thousands of times and hence a
normalization function should use division.


      reply	other threads:[~2008-10-30  7:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25  9:40 [2.6.28-rc1 regression] wmifinfo dockapp takes 100% of cpu (bisected) Carlos R. Mafra
2008-10-25 14:05 ` Arjan van de Ven
2008-10-25 14:13   ` Arjan van de Ven
2008-10-25 16:25     ` Carlos R. Mafra
2008-10-25 18:03       ` Marcin Slusarz
2008-10-25 18:29         ` Carlos R. Mafra
2008-10-25 18:39           ` Marcin Slusarz
2008-10-25 19:12         ` Arjan van de Ven
2008-10-25 19:38           ` Ray Lee
2008-10-30  7:04             ` Andrew Morton [this message]

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=20081030000442.fdc831c1.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=arjan@linux.intel.com \
    --cc=crmafra2@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=ray-lk@madrabbit.org \
    /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