I was looking around for targets for improvements on COW memory, and I’ve stumbled across one of Xorg’s private mappings:
flame@enterprise ~ % sudo smem `pidof X` | grep pcidata 196 kb 0 kb 196 kb /usr/lib64/xorg/modules/libpcidata.so 68 kb 0 kb 68 kb /usr/lib64/xorg/modules/libpcidata.so 536 kb 344 kb 0 kb /usr/lib64/xorg/modules/libpcidata.so
It’s quite some amount of memory used here. The problem is that libpcidata contains a lot of strings that need to e relocated. What those strings are? Well, simply a C compiled version of the pci.ids file.
Of course it’s faster to access pci.ids data at runtime after compiling it in C code at buildtime, but is it a good thing to do?
I admit I don’t know Xorg that well, but as far as I can see, the PCI scan happens when you actually start Xorg, as it’s used to identify the video card. So it’s saving time during Xorg’s bootup to use the compiled version rather than the system version. On the other hand it’s using a lot of memory during the rest of runtime, for no apparent good reason (to me at least).
I know the code is mostly historical, and I also know that requiring people using Xorg to install pciutils might be a bit farfetched, but really, I’ve read that on Planet Freedesktop too, if I recall correctly, we’re continuing reinventing the wheel.
My take on all this is that we should get pci.ids, usb.ids and whatever else data we can in one single big package, released by one single big project, and then let all the package rely on that single copy of it.
If any other distributor is reading this, let me know what you think, maybe we could get this done by all asking together to the authors.