> The following patch shrinks changes the implementation of> try_module_get() and friends to eliminate the special stopping of all> CPU's when a module is unloaded. Instead, it uses a read/write> semaphore in a perhaps slightly non-intuitive way.

Hmm, I was waiting a bit for Rusty's comment, but there isn't any...Anyway the patch below does the same, but it gets the module ref speculative and calls module_get_sync() if there is a problem.The patch is against an older kernel, but it should still apply and someone else has to get it past Rusty.BTW making the module ref functions not inline saves about 5KB with the standard config.