[clug] dd

Daniel Pittman daniel at rimspace.net
Sun Apr 11 19:15:48 MDT 2010

Alex Satrapa <grail at goldweb.com.au> writes:
> On 12/04/2010, at 10:31 , Daniel Pittman wrote:
>> ...er, they generally don't.
> Not recently for you perhaps.

...not generally for anyone, really, in my experience.

> I've had many cases where things like ethernet cards or disk controllers
> would be initialised in different orders each boot, I blame a race condition
> (whichever card was ready to respond to the PCI bus first got eth0), though
> it's entirely possible the kernel was written to deliberately do it in order
> to piss people like me off.

Linux PCI scanning and enumeration is synchronous, and always has been.  There
have been occasional experimental patches over the years to make it
asynchronous, but none of 'em ever made it into the mainline kernel.

A few times — three, IIRC — since the 2.2 era the order of PCI enumeration has
reversed, which means that two different kernel versions would detect cards
in a different order.  You would have to boot two different kernels to see
that, though.

So, I don't doubt your symptoms — unpredictable enumeration — exist, but your
assessment of why is almost certainly off in this case: the PCI race can't
exist, because there is no where for it to race.

> Recent kernels had that file in /etc/somethingoranother where you could bind
> particular PCI cards to particular ethernet numbers, for example.

*nod*  ...done in response to changes to device mapping when you added *new*
hardware[1], and in response to the exciting new world of hot-plug hardware.


> I've even had an experience where the hard drives in my boxen would come up
> as different disk numbers for no apparent reason. One boot, disk controller
> 1 gets to be the boot drive, next boot it's disk controller 2.

...without additional hardware change?  Did you have USB storage devices in
the machine or something?

Generally speaking, PCI scanning and HBA scanning is synchronous in Linux, so
it would deliver a deterministic (albeit not necessarily statically
predictable) device ordering.


[1]  This part has been supported forever with packages like ifrename and
     friends, back in the days when the only change would be a cold-plug
     device addition.

✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

More information about the linux mailing list