RE: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Jiri Slaby <jslaby@xxxxxxxxxx>, "jirislaby@xxxxxxxxx" <jirislaby@xxxxxxxxx>
- Subject: RE: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits
- From: "Luck, Tony" <tony.luck@xxxxxxxxx>
- Date: Wed, 18 Nov 2009 10:56:19 -0800
- Accept-language: en-US
- Acceptlanguage: en-US
- Cc: "mingo@xxxxxxx" <mingo@xxxxxxx>, "nhorman@xxxxxxxxxxxxx" <nhorman@xxxxxxxxxxxxx>, "sfr@xxxxxxxxxxxxxxxx" <sfr@xxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx" <akpm@xxxxxxxxxxxxxxxxxxxx>, "marcin.slusarz@xxxxxxxxx" <marcin.slusarz@xxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>, "mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "hpa@xxxxxxxxx" <hpa@xxxxxxxxx>, "torvalds@xxxxxxxxxxxxxxxxxxxx" <torvalds@xxxxxxxxxxxxxxxxxxxx>, James Morris <jmorris@xxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>
- In-reply-to: <1258555922-2064-3-git-send-email-jslaby@xxxxxxxxxx>
- List-id: <linux-ia64.vger.kernel.org>
- References: <4B040A03.2020508@xxxxxxxxx> <1258555922-2064-3-git-send-email-jslaby@xxxxxxxxxx>
- Thread-index: AcpoX748BhaLfwa1R2m2jZryl28ORQAIDTug
- Thread-topic: [PATCH 03/16] IA64: use ACCESS_ONCE for rlimits
> Make sure compiler won't do weird things with limits. E.g. fetching
> them twice may return 2 different values after writable limits are
> implemented.
- if (size > task->signal->rlim[RLIMIT_MEMLOCK].rlim_cur)
+ if (size > ACCESS_ONCE(task->signal->rlim[RLIMIT_MEMLOCK].rlim_cur))
I don't see how this helps. If someone else is changing limits while
we are looking at them, then there is a race. We either get the old
or the new value. Using ACCESS_ONCE (which on ia64 forces a "volatile"
access, which will make the compiler generate "ld.acq" rather than a
plain "ld") won't make any difference to this race.
Please explain what issue you see with the current code.
-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]