Hi, On Fri, 16 Sep 2005, Andrew Morton wrote: > Nope. On uniprocessor systems, atomic_foo() doesn't actually do the > buslocked atomic thing. > > #ifdef CONFIG_SMP > #define LOCK "lock ; " > #else > #define LOCK "" > #endif > > On x86, at least. Other architectures can do the same thing if they have > an atomic-wrt-IRQs add and sub. That's true on x86, but if these functions have to be emulated using spinlocks, they always have to disable interrupts, whether the caller needs it or not. Also x86 has the lock attribute, which helps a lot, but on other archs a cmpxchg instruction can be quite expensive, so it could be cheaper by just using {disable,enable}_preempt. bye, Roman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 1/5] atomic: introduce atomic_cmpxchg
- From: Nick Piggin <[email protected]>
- [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Nick Piggin <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Roman Zippel <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Nick Piggin <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Roman Zippel <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Russell King <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Roman Zippel <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Russell King <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Nick Piggin <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Roman Zippel <[email protected]>
- Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- From: Andrew Morton <[email protected]>
- [PATCH 1/5] atomic: introduce atomic_cmpxchg
- Prev by Date: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403
- Next by Date: free free irq and Oops on cat /proc/interrupts
- Previous by thread: Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- Next by thread: Re: [PATCH 2/5] atomic: introduce atomic_inc_not_zero
- Index(es):