I think having two APIs will be even more confusing than the current state.Yes, you're right, I did not get your idea before. Thanks for the explanation
But as I wrote I think you can have API to specify shallow depth in total
size and in sbitmap_queue_get_shallow() do:
shallow_per_word = (shallow_depth << sb->shift) / sb->depth;
rounding_index = shallow_depth - shallow_per_word * sb->depth;
and allow depth shallow_per_word + 1 if current index < rounding_index and
exactly shallow_per_word if current index >= rounding_index. This will
still evenly distribute shallow depth among words and I don't think the
additional overhead of the several arithmetic operations will be visible.