Re: [PATCH 15/17] fs/ext4: use cached rbtrees

From: Davidlohr Bueso
Date: Wed Jul 19 2017 - 18:51:30 EST


On Wed, 19 Jul 2017, Jan Kara wrote:

Hum, so I'm somewhat undecided whether this is worth the churn. For free
blocks rb_tree we use rb_first() only in ext4_mb_generate_from_freelist()
which gets called only when generating new buddy bitmap from on-disk bitmap
and we traverse the whole tree after that - thus the extra cost of
rb_first() is a) well hidden in the total cost of iteration, b) rather rare
anyway.

Yes, during some of the testing I did for this patch, I could not find trees
with more than just a handful of nodes, ie: while removing file(s).

Similarly for the H-tree directory code, we call rb_first() in
ext4_dx_readdir() only to start an iteration over the whole B-tree and in
such case I don't think optimizing rb_first() makes a big difference
(maintaining cached value is going to have about the same cost as we save
by using it).

Your reaction is rather expected, actually. Lets just leave this patch out.

Thanks,
Davidlohr