Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jan 2008 15:36:16 +0100
From:      "Attilio Rao" <attilio@freebsd.org>
To:        "John Baldwin" <jhb@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, David Xu <davidxu@freebsd.org>, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/kern kern_time.c
Message-ID:  <3bbf2fe10801180636q3e286316w9ca685f92cf53828@mail.gmail.com>
In-Reply-To: <200801180929.45123.jhb@freebsd.org>
References:  <200801181300.m0ID0SMi041767@repoman.freebsd.org> <3bbf2fe10801180534y7f97f39meb0b12624e0b919a@mail.gmail.com> <200801180929.45123.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2008/1/18, John Baldwin <jhb@freebsd.org>:
> On Friday 18 January 2008 08:34:57 am Attilio Rao wrote:
> > 2008/1/18, David Xu <davidxu@freebsd.org>:
> > > davidxu     2008-01-18 13:00:28 UTC
> > >
> > >   FreeBSD src repository
> > >
> > >   Modified files:
> > >     sys/kern             kern_time.c
> > >   Log:
> > >   Make sure reading td_runtime in critical section since thread may be
> > >   preempted and td_runtime will be modified.
> >
> > If you don't need the operation to be atomical with other operations
> > inside the critical path (and I don't expect so) this change is
> > pointless as our reading are always atomic.
>
> Not on 32-bit archs like i386.  They may do two 32-bit reads and you could
> have problems if the lower 32 wraps in between the reads.

Ah, right, td_runtime is uint64_t, sorry.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10801180636q3e286316w9ca685f92cf53828>