[Linux-fbdev-devel] [PATCH 1/4 (updated)] ps3fb: thread updates
Geert Uytterhoeven
Geert.Uytterhoeven at sonycom.com
Tue Feb 20 01:07:25 EST 2007
On Fri, 16 Feb 2007, Geert Uytterhoeven wrote:
> On Fri, 16 Feb 2007, Christoph Hellwig wrote:
> > > + DEFINE_WAIT(wait);
> > > + DECLARE_WAIT_QUEUE_HEAD(wq);
> > > +
> > > + while (!kthread_should_stop()) {
> > > + prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);
> > > + if (!ps3fb.is_kicked)
> > > + schedule();
> > > + finish_wait(&wq, &wait);
> > > + ps3fb.is_kicked = 0;
> > > + ps3fb_sync(0); /* single buffer */
> >
> > should probably be just:
> >
> > while (!kthread_should_stop()) {
> > ps3fb_sync(0);
> > schedule();
> > }
> >
> > given that you don't need a waitqueue and a spurious wakeup here
> > seems harmless.
>
> Not always. If flipping is disabled, or external flip is enabled, you don't
> want a spurious flip.
Looks like the waitqueue is needed. Without it ps3fbd runs at 100% CPU and +15
million loops per second.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven at sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
More information about the Linuxppc-dev
mailing list