From: Coly Li <colyli@xxxxxxx> which_dev() is a top hot function in md-linear.c, every I/O request will call it to find out which component disk the bio should be issued to. Current witch_dev() performs a standard binary search, indeed this is not the fastest algorithm in practice. When the whole conf->disks array can be stored within a single cache line, simple linear search is faster than binary search for a small disks number.