On Fri, Mar 13, 2020 at 05:06:59AM +0000, George Spelvin wrote: > I'd just like to mention that the is_vmalloc_addr() test depends only on > the virtual address, so can be done when the memory is queued, before the > grace period. That is, you could have kfree_rcu(), vfree_rcu(), and a > kvfree_rcu() function which decides between them. > > One advantage of that would be that you could put the vfree() sanity > checks into vfree_rcu(), so errors would have a useful backtrace, > and just do the __vunmap when the grace period expires. > > Or you could build a mixed queue and do the is_vmalloc_addr() test at > the end of the grace period. That was my original idea, because it > avoids the need for a separate queue. (In the _rcu_bulk_data structure, > you can do a quicksort-style partitioning on is_vmalloc_addr(), so > the kfree_bulk() pointers are all contiguous.) > > Just an implementation option. Thanks for your input. Mixed queue would require sorting, one node can contain up to ~509 elements if PAGE_SIZE is 4096, so i am not sure how it would impact performance under heavy load. But anyway, thanks again. -- Vlad Rezki