Re: Kernel 2.4.3 and new aic7xxx

From: Justin T. Gibbs (gibbs@scsiguy.com)
Date: Wed Mar 07 2001 - 17:43:39 EST


>I would prefer to sort the list at probe not boot time. That makes it
>easy to reverse the order on the fly, depending on what the driver
>requests at runtime. It's SMP-friendly, because I can grab a private
>copy of the PCI device list, sort it, and scan it. You don't have to
>re-sort at every pci_insert_device, for hotplug machines. The only
>potential downside is I need to check and see if the bootmem case needs
>to be handled, when making a private copy of the pci devices list for
>sorting.

How often is the list manipulated? My guess is not very often.
You can allow people to read the list without taking a spinlock and
only acquire the spinlock on list manipulations. Inserting an
element can be performed atomically so there isn't an SMP issue
so long as you don't allow more than one processor to insert at
the same time. This would allow you to perform insertion sort
meaning that everything from /proc to device drivers auto-magically
sees the devices in the order they were probed. For hot plug devices
you might want to insert them at the end to follow the "order probed"
motif.

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



This archive was generated by hypermail 2b29 : Wed Mar 07 2001 - 21:00:24 EST