On 10 Apr 2019, at 2:51, Nikolay Borisov wrote: > On 10.04.19 г. 9:34 ч., Qu Wenruo wrote: >> Hi, >> >> As we have memleak.py in bcc tools, and it provides better info >> including the calling stack, I'm wondering if we should replace >> current >> eb leakage check with bcc based one. >> >> Any idea on this? > > Why do you want to change it, given that the existing one is only > activate if btrfs is compiled with debug enabled and is "seamless"? > What > are we going to gain by introducing yet another tool or replacing an > existing infrastructure with bcc (or whatever) based one?
bcc/bpf are able to give much more information about which call chain allocated the extent buffer, but unfortunately almost all eb's come from the same place. But, the bpf version could remember every call stack that did an inc/dec on the reference counter, which does make it dramatically easier to track down leaks. With all of that said, the real reason I love the extent buffer leak code is that when chasing down a leak, I could rmmod btrfs, have the leak detector print a helpful warning, and then cleanup the slab cache so that I didn't have to reboot the test machine. bpf code on top could definitely make it faster to find the cause of leaks, but I think the slab cleanup is worth keeping around. -chris