From owner-freebsd-geom@FreeBSD.ORG Mon Apr 15 19:39:17 2013 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18DA7EC3; Mon, 15 Apr 2013 19:39:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9DAD5164D; Mon, 15 Apr 2013 19:39:16 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3FJdD1Y022713; Mon, 15 Apr 2013 22:39:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3FJdD1Y022713 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3FJdD2n022712; Mon, 15 Apr 2013 22:39:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Apr 2013 22:39:12 +0300 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: devstat overhead VS precision Message-ID: <20130415193912.GS2930@kib.kiev.ua> References: <51692C95.3010901@FreeBSD.org> <20130415184203.GA1839@garage.freebsd.pl> <20130415191815.GR2930@kib.kiev.ua> <20130415193730.GB1839@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qxmd2aOE9n9J83EO" Content-Disposition: inline In-Reply-To: <20130415193730.GB1839@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-hackers@FreeBSD.org, Alexander Motin , freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 19:39:17 -0000 --qxmd2aOE9n9J83EO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2013 at 09:37:30PM +0200, Pawel Jakub Dawidek wrote: > On Mon, Apr 15, 2013 at 10:18:15PM +0300, Konstantin Belousov wrote: > > On Mon, Apr 15, 2013 at 08:42:03PM +0200, Pawel Jakub Dawidek wrote: > > > On a mostly unrelated note when two threads (T0 and T1) call get*time= () > > > on two different cores, but T0 does that a bit earlier is it possible > > > that T0 can get later time than T1? > >=20 > > Define earlier first. > >=20 > > If you have taken sufficient measures to prevent preemption and interru= ption, > > e.g. by entering spinlock before the fragment that calls get*, then no, > > it is impossible, at least not with any x86 timekeeping hardware we use. > >=20 > > On the other hand, if interrupts are allowed, all bets are off. >=20 > So if we consider only one thread, it is not possible for it to obtain > time t0, be scheduled to different CPU and obtain t1 where t1 < t0? Yes, I believe this scenario is also not possible. The context switching ensures that thread's view on the global memory is consistent. At least it is so on x86, and I think it must be the same on all other architectures. Otherwise the compiler emited code would not work. --qxmd2aOE9n9J83EO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRbFdgAAoJEJDCuSvBvK1BHHwP/3jWyITU2jLV7rr4PL9byXPW 5It47gDGungmtlGIiPj7s5t9Apq4DvZ9G7kBNvR/1FjATVPbXa9TPvo6t8qqGrEm 7CIq72pt6B0BcxwBLD3cLDU6qQfm5hMu5VkJqKFGg/LpWzKkHOvGt2ostDEY5N79 WQldd1wJsRp25SsFChsb/z9RXBKIcCJvc3ukUxTQAblaIIoQ3dThUpVv+pN5/pl/ yj2URn44dQTJkNNQw4mUN72PHf66wFeYpw3I2U8Lr1LMdl/2PGuM4gbancjeGSp3 md7EoKrGll6/8lH58X4aVgHDjbqD7/ccDCn8yNok2FwaDSyiuUqUPyYTGIiCExgm Ni+71fyyL9wFd79n93ovC6LrqwaB8Lvn8fOydGp8ZPIRDRl0d+dEbhD8FUaaCaUk wl0TmhOZVarWJBstiOunWHlVeLkltcSdfV9X8gyp0ThFJZfM9nbgPdMdawRaIQ+v H1lWbXBhAFA+kwwM2zZSf1YiOvUGVbjf/Y0XSR6i6rSmhjJl2QA9BYX/Gr60I1Fg hQr9JlBsLOCZbqNX7f4KdjucVOjKLsdDyk10on4pGYIQXHCmNO28bhNiKxiqYMkP aYervPFifouuO9LvcGkQqD1XIJH4mQfSKLQtkTpKd44Sf1avoqHFu37SYp3+Fu51 eq5VSCa48ydDx69Wujek =KrTY -----END PGP SIGNATURE----- --qxmd2aOE9n9J83EO--