On Thu, Aug 08, 2019 at 01:51:29PM -0700, Paul E. McKenney wrote: [snip] > > Also, I am thinking that whenever we do per-slab optimization, then the > > kmem_cache_free_bulk() can be optimized further. If all pointers are on the > > same slab, then we can just do virt_to_cache on the first pointer and avoid > > repeated virt_to_cache() calls. That might also give a benefit -- but I could > > be missing something. > > A sort might be required to make that work nicely, which would add some > overhead. Probably not that much, though, the increased locality would > have a fighting chance of overcoming the sort's overhead. > > > Right now kmem_cache_free_bulk() just looks like a kmem_cache_free() in a > > loop except the small benefit of not disabling/enabling IRQs across each > > __cache_free, and the reduced cache miss benefit of using the array. > > C'mon! Show some respect for the awesome power of temporal locality!!! ;-) Good point. I will try to respect it more in the future ;-) After all, it is quite a useful concept. thanks, - Joel