Re: [PATCH] Introduce atomic_long_t and asm-generic/atomic.h

From: Christoph Lameter
Date: Mon Dec 12 2005 - 18:51:36 EST


On Mon, 12 Dec 2005, Andrew Morton wrote:

> It assumes that sizeof(long) = sizeof(int) ifndef ATOMIC64_INIT. Which is
> true, but there are still problems. For example, I'd reasonably expect this:

If ATOMIC64_INIT is not defined then atomic_t == atomic_long_t. Everything
beyond that comes already with atomic_t.

> printk("%ld", atomic_long_read(v));
>
> to not produce a warning. It may also lead to long*/int* warnings or build
> errors.

The mm_counter_t logic in include/linux/sched.h already does the same as
this patch. So we already have that issue.

> Also, it kind-of assumes that each 64-bit arch uses `long' for its 64-bit
> value. sh64, for example, appears to use `long long'.

sh64 has no atomic64 support. And so atomic_long will be 32bit.

Hmmm.. Maybe rename atomic_long_t to something else?

-
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/