Re: [Dri-devel] [PATCH] cpu_relax whilst in busy-wait loops.

From: Michel Dänzer
Date: Wed Aug 13 2003 - 05:26:21 EST


On Mon, 2003-08-11 at 15:40, davej@xxxxxxxxxx wrote:
> diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/char/drm/gamma_dma.c linux-2.5/drivers/char/drm/gamma_dma.c
> -- bk-linus/drivers/char/drm/gamma_dma.c 2003-05-31 15:58:40.000000000 +0100
> +++ linux-2.5/drivers/char/drm/gamma_dma.c 2003-05-29 14:07:46.000000000 +0100
> @@ -44,9 +44,14 @@ static inline void gamma_dma_dispatch(dr
> drm_gamma_private_t *dev_priv =
> (drm_gamma_private_t *)dev->dev_private;
> mb();
> - while ( GAMMA_READ(GAMMA_INFIFOSPACE) < 2);
> + while ( GAMMA_READ(GAMMA_INFIFOSPACE) < 2)
> + cpu_relax();
> +

[...]

Are you actually using the gamma driver? :) Something like this might be
useful in other drivers as well?


--
Earthling Michel DÃnzer \ Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast \ http://svcs.affero.net/rm.php?r=daenzer

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/