• Kent Overstreet's avatar
    bcachefs: Fix btree_trans list ordering · 1aaf5cb4
    Kent Overstreet authored
    The debug code relies on btree_trans_list being ordered so that it can
    resume on subsequent calls or lock restarts.
    
    However, it was using trans->locknig_wait.task.pid, which is incorrect
    since btree_trans objects are cached and reused - typically by different
    tasks.
    
    Fix this by switching to pointer order, and also sort them lazily when
    required - speeding up the btree_trans_get() fastpath.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    1aaf5cb4
btree_iter.c 89.7 KB