On Wed, Sep 26, 2018 at 10:17:13PM +0800, Qu Wenruo wrote: > >> Before this patch, quota will mark the whole subtree from its parent > >> down to the leaves as dirty. > >> So btrfs quota need to trace all tree block from (a) to (g). > > > > I find the use of 'trace' a bit confusing as there are the trace events, > > but as it's already used in the qgroup code I think it can stay as is. > > I'm pretty open to rename the word "trace". > > Any recommendation for a newer name?
No, we can rename the functions later if needed. > >> However tree blocks (d) (e) (f) are shared between both trees, thus > >> there is no need to trace those 3 tree blocks. > >> > >> This patchset will change how this work by only tracing modified tree > >> blocks in reloc tree, and their counter parts in file tree. > >> > >> With this patch, we could skip tree blocks OO(d)~OO(f) in above example, > >> thus reduce some some overhead caused by qgroup. > >> > >> The improvement is mostly related to metadata relocation. > >> > >> Also, for metadata relocation, we don't really need to trace data > >> extents as they're not modified at all. > >> > >> > >> [[Benchmark]] > > [...] > > > > Thanks for the benchmarks, it would be good to add the information to > > the patch that's bringing the performance improvement. > > Could do that. > > However the current improved (from around 10 * nr_relocated to 6~7 * > nr_relocated) is the final result of the last 4 patches. > > I'm not pretty sure if any single patch could bring obvious improvement. Patch 5 would be a good candidate, noting that further patches bring more performance improvements.