Re: [PATCH 3/4] IPMI: convert locked counters to atomics
From: Andrew Morton
Date: Thu Feb 14 2008 - 14:12:23 EST
> + for (i = 0; i < IPMI_NUM_STATS; i++)
> + atomic_set(&intf->stats[i], 0);
And this is why it would be very hard for any architecture to ever
implement atomic_t as
struct atomic_t {
int counter;
spinlock_t lock;
};
The interface assumes that atomic_set() fully initialises the atomic_t, and
that atomic_set() can be used agaisnt both an uninitialised atomic_t and
against an already-initialised atomic_t. IOW, we don't have atomic_init().
So would our hypothetical future architcture's atomic_set() do spin_lock(),
or would it do spin_lock_init()? Either one is wrong in many atomic_set
callsites.
Oh well.
--
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/