On Thursday 16 August 2007 01:39, Satyam Sharma wrote: > > static inline void wait_for_init_deassert(atomic_t *deassert) > { > - while (!atomic_read(deassert)); > + while (!atomic_read(deassert)) > + cpu_relax(); > return; > } For less-than-briliant people like me, it's totally non-obvious that cpu_relax() is needed for correctness here, not just to make P4 happy. IOW: "atomic_read" name quite unambiguously means "I will read this variable from main memory". Which is not true and creates potential for confusion and bugs. -- vda - 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/
- Follow-Ups:
- RE: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- From: "Luck, Tony" <[email protected]>
- Re: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- From: Satyam Sharma <[email protected]>
- RE: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- From: "Kenn Humborg" <[email protected]>
- Re: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- From: Andi Kleen <[email protected]>
- RE: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- References:
- Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
- From: Chris Snook <[email protected]>
- Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
- From: Heiko Carstens <[email protected]>
- [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- From: Satyam Sharma <[email protected]>
- Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
- Prev by Date: Re: [Tech-board-discuss] Re: [Ksummit-2007-discuss] Re: Linux Foundation Technical Advisory Board Elections
- Next by Date: Re: 2.6.22.5 forcedeth timeout hang
- Previous by thread: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- Next by thread: Re: [PATCH] i386: Fix a couple busy loops in mach_wakecpu.h:wait_for_init_deassert()
- Index(es):