Re: can IOKit driver be paged out?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Not a silly question - some other OS's allow kernel memory to be paged. Cheers, - Dean Regards, Parav Pandit _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Dec 10, 2004, at 07:28, Parav Pandit wrote: I just want to know, whenever we load IOKit driver using kextload command, does IOKit driver wired down in the memory or can it be paged out whenever there is a lack of memory? and what about the xnu_kernel, I think it can't be paged out otherwise who will do this paging? IOKit drivers, kernel text, and most kernel memory allocations are wired for all versions of OS X. If your kext is really huge, you can break it into pieces that load on demand (have one small kext that monitors the port for an open, and then brings in the "real" driver to handle I/O). If I asked a very silly question, please pardon me for it. If you are interested in tracking your kext's memory usage, here are a few tools you can use: 1) /usr/sbin/kextstat shows you how much memory is wired for text and static data for each loaded kext. 2) /usr/sbin/ioclasscount shows you how many instances of each class you care about are present. 3) /usr/sbin/ioalloccount shows you how much memory is being used by IOKit in total (not counting allocations made via non-IOKit APIs) You can often spot leaks in your code by writing a loop that executes ioclasscount for all classes your driver defines or references, as well as ioalloccount, followed by some major operation for your driver (could be load/unload, could be open/close, etc...). You then watch for any steady ascent in any of the allocation numbers. This email sent to site_archiver@lists.apple.com
participants (1)
-
Dean Reece