[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <a2ebde260609290733m207780f0t8601e04fcf64f0a6@mail.gmail.com>
Date: Fri, 29 Sep 2006 22:33:54 +0800
From: "Dong Feng" <middle.fengdong@...il.com>
To: "Andi Kleen" <ak@...e.de>, "Nick Piggin" <nickpiggin@...oo.com.au>,
"Arjan van de Ven" <arjan@...radead.org>,
"Dong Feng" <middle.fengdong@...il.com>,
"Paul Mackerras" <paulus@...ba.org>,
"Christoph Lameter" <clameter@....com>,
"David Howells" <dhowells@...hat.com>
Cc: linux-kernel@...r.kernel.org
Subject: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists