On Wed, 25 Jan 2017, Loic Dachary wrote: > Hi Sage, > > While documenting crush_reweight_bucket[1] I came accross something that > I don't understand when reweighting uniform buckets[2]. The associated > commit[3] is six years old but maybe your remember why the item_weight > had to be adjusted with the average of the weight of the buckets... but > only if there are more buckets than leaves ? I think it's just a half-hearted attempt to Do The Right Thing when the situation is nonsensical. Uniform buckets are meant to be used with leave (device) items of fixed weight (item_weight). If you (ab)use them with bucket children, the algorithm can't really do the right thing because it doesn't understand the child bucket weights. If there are a lot of bucket children it resets item_weight to their average. This is probably pointless... we could just remove it, and perhaps warn (or error out?) in CrushCompiler if a uniform bucket child is a non-device. s > > Cheers > > [1] http://libcrush.org/main/libcrush/blob/wip-2-doxygen/crush/builder.h#L111 > [2] http://libcrush.org/main/libcrush/blob/wip-2-doxygen/crush/builder.c#L1282 > [3] http://libcrush.org/main/libcrush/commit/60f627f88c6314c5a89bb7119ead907ca8b8ef37 > > -- > Loïc Dachary, Artisan Logiciel Libre > >