Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- From: "Dong Feng" <middle.fengdong@xxxxxxxxx>
- Date: Sat, 30 Sep 2006 00:16:07 +0800
2006/9/30, Christoph Lameter <clameter@xxxxxxx>:
On Fri, 29 Sep 2006, Dong Feng wrote:
> For my understanding, an assignment between structs should be a
> bit-wise copy. Such operation is not atomic, so it can not be supposed
Byte or Machine word yes.
> SMP-safe. And the subsequent test-and-assign operation on firsttime is
> not atomic, either.
No its not atomic on its own. Correct.
> If the comments mean the subsequent code is SMP-safe and can prevent
> nest-kernel-path, how does it achieves that?
It relies on locking outside of do_sys_settimeofday(). Seems that this
indicates locking is to be performed by the arch before calling
do_sys_settimeofday. Looks suspicious to me. Check that this function is
always called with the same lock.
Yes, that is the question. The whole invocation path is
sys_settimeofday() -> do_sys_settimeofday()
I do not find a lock embracing do_sys_settimeofday().
Moreover, seems neither write operations nor read operations on sys_tz
is protected by any locks, in sys_gettimeofday() and
sys_settimeofday() respectively.
-
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/
- Follow-Ups:
- References:
- How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- From: Dong Feng
- Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- From: Christoph Lameter
- How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- Prev by Date: Re: [2.6.18-rc7-mm1] slow boot
- Next by Date: Re: [RFC][PATCH 00/10] Task watchers v2 Introduction
- Previous by thread: Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- Next by thread: Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
- Index(es):