public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
@ 2006-09-29 14:33 Dong Feng
  2006-09-29 16:05 ` Christoph Lameter
  0 siblings, 1 reply; 14+ messages in thread
From: Dong Feng @ 2006-09-29 14:33 UTC (permalink / raw)
  To: Andi Kleen, Nick Piggin, Arjan van de Ven, Dong Feng,
	Paul Mackerras, Christoph Lameter, David Howells
  Cc: linux-kernel

Hi, all,

I got a question, that is, I am confused by the following code in
do_sys_settimeofday().

if (tz) {
    /* SMP safe, global irq locking makes it work. */
        sys_tz = *tz;
        if (firsttime) {
            firsttime = 0;
            if (!tv)
                warp_clock();
    }
}


For my understanding, an assignment between structs should be a
bit-wise copy. Such operation is not atomic, so it can not be supposed
SMP-safe. And the subsequent test-and-assign operation on firsttime is
not atomic, either.

If the comments mean the subsequent code is SMP-safe and can prevent
nest-kernel-path, how does it achieves that?

Thank you in advance.
Feng,Dong

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-10-03 10:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-29 14:33 How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path? Dong Feng
2006-09-29 16:05 ` Christoph Lameter
2006-09-29 16:16   ` Dong Feng
2006-09-30 14:37     ` Nick Piggin
2006-09-30 15:03       ` Andi Kleen
2006-09-30 17:13         ` Christoph Lameter
2006-10-02 10:08         ` Samuel Tardieu
2006-10-03  8:03         ` Pavel Machek
2006-10-03 10:03           ` Andi Kleen
2006-09-30 16:09       ` Dong Feng
2006-09-30 17:26         ` Christoph Lameter
2006-10-01  3:48           ` Nick Piggin
2006-10-01 12:22             ` Dong Feng
2006-10-02 10:12           ` Samuel Tardieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox