On Mon, 1 Jan 2018, Matthew Wilcox wrote: > I thought of a cute additional slab operation we could define, print(). > We could do something like this ... > > struct page *page = virt_to_head_page(ptr); > if (!PageSlab(page)) > return false; > slab = page->slab_cache; > if (!(slab->flags & SLAB_FLAGS_OPS) || !slab->ops->print) > return false; > slab->ops->print(ptr); > return true; > > and get nice debugging output like we have for VM_BUG_ON_PAGE, only > for any type that's implemented a slab operations vec. Of course, this > won't replace VM_BUG_ON_PAGE because struct pages aren't slab-allocated > (but could we pretend they are?) Cute... -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>