On 8/11/22 08:53, Hyeonggon Yoo wrote: > > I started to wonder... > > Do we need slab_lock() after this patch for debugging caches? > > if SLUB never takes a slab from partial list (unless moving to another list or freeing it), > and if you must acquire list_lock before accessing (to alloc/free objects) per-node partial list, > Why do we need it? Yeah, looks like we shouldn't need it anymore as n->list_lock will cover everything now. Great observation! > Of course, it is still needed for ARCHs that does not support > cmpxchg_double(). > > But as code for debugging caches is separated after this patch, > maybe we can simply drop slab_lock() in: > - alloc_debug_processing() > - free_debug_processing() > - alloc_single_from_{new_slab,partial}() > - validate_slab() list_slab_objects() too, with some care for the locking in get_map(). > And also relevant comments. As it's becoming too large, I will split this to more patches. Thanks!