On 2020-06-06 11:38, Avri Altman wrote: >> + for (i = 0; i < bit_len; i++) { >> + if (test_bit(srgn_offset + i, srgn->mctx->ppn_dirty)) > > Maybe use a mask or hweight instead of testing bit by bit? How about using find_next_bit() from include/linux/bitmap.h? /* * find_next_bit(addr, nbits, bit) Position next set bit in *addr * >= bit */ Thanks, Bart.