fn log2_upper(n: u64) -> u32
Return an upper bound for the log2 of n.
This function overestimates whenever n is a power of two, but that doesn’t much matter for the uses we’re giving it here.