mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dong Feng" <middle.fengdong@gmail.com>
To: "Christoph Lameter" <clameter@sgi.com>
Cc: "Andi Kleen" <ak@suse.de>,
	"Nick Piggin" <nickpiggin@yahoo.com.au>,
	"Arjan van de Ven" <arjan@infradead.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"David Howells" <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: How is Code in do_sys_settimeofday() safe in case of SMP and Nest Kernel Path?
Date: Sat, 30 Sep 2006 00:16:07 +0800	[thread overview]
Message-ID: <a2ebde260609290916j3a3deb9g33434ca5d93e7a84@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0609290903550.23840@schroedinger.engr.sgi.com>

2006/9/30, Christoph Lameter <clameter@sgi.com>:
> 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.

  reply	other threads:[~2006-09-29 16:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29 14:33 Dong Feng
2006-09-29 16:05 ` Christoph Lameter
2006-09-29 16:16   ` Dong Feng [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2ebde260609290916j3a3deb9g33434ca5d93e7a84@mail.gmail.com \
    --to=middle.fengdong@gmail.com \
    --cc=ak@suse.de \
    --cc=arjan@infradead.org \
    --cc=clameter@sgi.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome