Re: [PATCH 23/33] generic dynamic per cpu refcounting

From: Theodore Ts'o
Date: Tue Apr 02 2013 - 12:28:01 EST


Reviewed-by: "Theodore Ts'o" <tytso@xxxxxxx>

> + v = atomic64_add_return(1 + (1ULL << PCPU_COUNT_BITS),
> + &ref->count);
> +
> + if (!(v >> PCPU_COUNT_BITS) &&
> + REF_STATUS(pcpu_count) == PCPU_REF_NONE && alloc)
> + percpu_ref_alloc(ref, pcpu_count);

This assumes that the kernel is compiled with -fno-strict-overflow.
Which we do, and this is not the only place int the kernel where we
depend on this, so while I was nervous before, I'm okay with it now.
Could we at least have a comment saying that we're depending on
-fno-strict-overflow, though?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/