From: "Kay Sievers" Date: Thu, 23 Oct 2008 19:09:32 +0000 Subject: Re: replace in-memory rules array with match/action token list Message-Id: List-Id: References: <4900419F.7010405@tuffmail.co.uk> In-Reply-To: <4900419F.7010405@tuffmail.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Thu, Oct 23, 2008 at 18:10, Alan Jenkins w= rote: > Kay Sievers wrote: >> On Thu, Oct 23, 2008 at 16:16, Alan Jenkins wrote: >>> Kay Sievers wrote: >>>> On Thu, Oct 23, 2008 at 13:34, Alan Jenkins wrote: >>>>> Alan Jenkins wrote: >>>>> >>>>>>> The in-memory rule array of a common desktop distro install took: >>>>>>> 1151088 bytes >>>>>>> with the token list: >>>>>>> 109232 bytes tokens (6827 * 16 bytes), 71302 bytes buffer >>>>>>> >>>>>> Sounds great from a performance point of view. > There's also a call usleep() in rename_netif(). > Perhaps this error message is significant: > > "error changing netif name ath0 to ath1: Device or resource busy" > > It only happens with the bad version. The good version doesn't try to > rename the interface from "ath0". I've attached my rules file. > > But this error should cause rename_netif() to return without calling > usleep(). > And anticipating your next question: > > # grep WAIT /etc/udev/rules.d/* > /etc/udev/rules.d/05-udev-early.rules:ACTION=3D"add", > KERNEL=3D"[0-9]*:[0-9]*", SUBSYSTEM=3D"scsi", WAIT_FOR_SYSFS=3D"ioerr_cnt" Yeah, this is no longer needed with recent kernels, and I don't have it, so I didn't notice the wrong ordering. > 1) The attached rules are being interpreted differently, changing the > name of the device. > # PCI device 0x168c:0x001c (ath_pci) > SUBSYSTEM=3D"net", DRIVERS=3D"?*", ATTRS{address}=3D"00:15:af:87:43:9f", = ATTRS{type}=3D"1", NAME=3D"ath0" > # PCI device 0x168c:0000:01:00.0 (ath5k_pci) > SUBSYSTEM=3D"net", ACTION=3D"add", DRIVERS=3D"?*", ATTR{address}=3D"00:15= :af:87:43:9f", ATTR{type}=3D"1", KERNEL=3D"ath*", NAME=3D"ath1" For some reason you have duplicated MAC addresses here, which must not happen. Might becaused by something like this bug: http://git.kernel.org/?p=3Dlinux/hotplug/udev.git;a=3Dcommitdiff;h=9Bdca4= 42ef3f7d54cea9827605ec635712009735 The new rule engine, does not special-case NAME=3D, so the last assignment wins. Only NAME:=3D would prevent later changes as usual. Thanks, Kay