[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080904161424.GA23042@elte.hu>
Date: Thu, 4 Sep 2008 18:14:24 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Matthew Wilcox <matthew@....cx>
Cc: Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...l.org>,
Andrew Morton <akpm@...l.org>,
Ben Hutchings <bhutchings@...arflare.com>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-pci@...r.kernel.org,
Stephen Hemminger <shemminger@...tta.com>
Subject: Re: [PATCH] Return value from schedule()
* Matthew Wilcox <matthew@....cx> wrote:
> In some circumstances, you want to wait for an event to happen. let's
> assume that it's a hardware event, so you can't just add a notifier of
> some kind, you have to poll. Here's an example:
>
> On Wed, Sep 03, 2008 at 03:57:13PM -0700, Stephen Hemminger wrote:
> > return -ETIMEDOUT;
> > - udelay(10);
> > + if (signal_pending(current))
> > + return -EINTR;
> > + schedule();
>
> If there's no other task ready to run, schedule() could return in much
> less than 10 microseconds (actually, it could return in much less than
> 10 microseconds even if another task does run, but let's ignore that case).
>
> If schedule() returned whether or not it had scheduled another task, we
> could do something like:
>
> if (!schedule())
> udelay(10);
hm, i'm not really sure - this really just seems to be a higher prio
variant of yield() combined with some weird code. Do we really want to
promote such arguably broken behavior? If there's any chance of any
polling to take a material amount of CPU time it should be event driven
to begin with.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists