On Wed, 30 Aug 2017 08:05:57 +0200, Greg KH rote: > On Tue, Aug 29, 2017 at 04:22:34PM +0000, Grant Edwards wrote: >> Roughly how much kernel memory is allocated for a UART by >> uart_register_driver() for UARTS that never get instantiated by >> uart_add_one_port()? >> >> A few KB, tens of KB, hundreds of KB? >> [...] > > Should be a pretty easy thing for you to test yourself, right? Build > two different kernels, look at the memory used, and there you go... How do you "look at the memory used"? After a few hours googling, the general consensus seemed to be that there is no practical way to determine the amount of memory allocated by a particular module. The only suggestion I found was to watch slabtop while loading and unloading the module -- along with a caveat that it usually didn't provide useful info. I found the caveat to be well-founded. If one assume the memory allocated by the module can be seen by an increase in the total "active" memory upon 'insmod' and a decrease upon 'rmmod', then the memory allocated by the driver is somewhere in the range of -20KB to +150KB. And there was no observable difference between allocating space for 32 ports vs. allocating space for 256 ports. -- Grant Edwards grant.b.edwards Yow! I think I am an at overnight sensation right gmail.com now!! -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html