Skip to content

Commit 3102b0a

Browse files
committed
crush: add note about r in recursive choose
Reflects ceph.git commit 4551fee9ad89d0427ed865d766d0d44004d3e3e1. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
1 parent 9a3b490 commit 3102b0a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎net/ceph/crush/mapper.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,14 @@ static void crush_choose_indep(const struct crush_map *map,
514514

515515
/* choose through intervening buckets */
516516
for (;;) {
517+
/* note: we base the choice on the position
518+
* even in the nested call. that means that
519+
* if the first layer chooses the same bucket
520+
* in a different position, we will tend to
521+
* choose a different item in that bucket.
522+
* this will involve more devices in data
523+
* movement and tend to distribute the load.
524+
*/
517525
r = rep;
518526

519527
/* be careful */

0 commit comments

Comments
 (0)