Re: [PATCH -mm 2/6] cpu_relax(): ide_wait_stat()

From: Alan Cox
Date: Wed Jun 21 2006 - 18:03:14 EST


Ar Mer, 2006-06-21 am 22:59 +0200, ysgrifennodd Andreas Mohr:
> Add cpu_relax() to drivers/ide/ide-iops.c/ide_wait_stat().

You don't need cpu_relax() when the loop contains a reference to
external memory busses. The CPU will stall on the inb() anyway, and when
this occurs processors with multiple-threads will do the right thing
implicitly. If you could look at the instruction stream it would look
something like

dec count
jump out if zero
inb
read request to the bus
[stall]
then to the PCI bridge
[stall]
then eventually to the device
[Huge mindbogglingly relativley long period of time stalled]
answer finally arrives back over the PCI bus
compare
...


Same comment for floppy. Rest look ok

Perhaps this needs documenting however.

Alan

-
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/