Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2013 10:33:43 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff <glebius@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r252032 - head/sys/amd64/include
Message-ID:  <20130623073343.GY91021@kib.kiev.ua>
In-Reply-To: <20130622174921.I3112@besplex.bde.org>
References:  <201306201430.r5KEU4G5049115@svn.freebsd.org> <20130621065839.J916@besplex.bde.org> <20130621081116.E1151@besplex.bde.org> <20130621090207.F1318@besplex.bde.org> <20130621064901.GS1214@FreeBSD.org> <20130621184140.G848@besplex.bde.org> <20130621135427.GA1214@FreeBSD.org> <20130622110352.J2033@besplex.bde.org> <20130622124832.S2347@besplex.bde.org> <20130622174921.I3112@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--to1uSGBmQtEag2WO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Jun 22, 2013 at 06:58:15PM +1000, Bruce Evans wrote:
> So the i386 version be simply "addl; adcl" to memory.  Each store in
> this is atomic at the per-CPU level.  If there is no carry, then the
> separate stores are equivalent to adding separate nonnegative values and
> the counter value is valid at all times.  If there is carry, then the
> separate stores are equivalent to adding a negative value followed by
> a larger positive value.  The counter transiently goes backwards, but
> no information is lost and the counter is eventually set to the correct
> forward-going value.

This is quite interesting idea, but I still did not decided if it
acceptable.  The issue is that we could add the carry to the other
processor counter, if the preemption kicks in at right time between
two instructions.  I did not found any argument why would it be
wrong, the races for fetch operation seems to be the same with either
local update method.

On the other hand, for debugging it would be quite confusing state of
the counters array to observe.

--to1uSGBmQtEag2WO
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQIcBAEBAgAGBQJRxqTWAAoJEJDCuSvBvK1ByLQP/2foifYLfz0tYSdbcwQIGafb
iuJYFO2RLJTTA1+doHSOuYV2LlaqOQb/TmdfRWOuXm+XU5p77T/WBqZnXab68GUO
/MB7XLCuWl1FNm4zFVV/0VF9aDxY6aJZwTL/t+gsML3huTGJqB04aD0XCmy18TBa
fNSiF7KU/EyPeQtY2TR9UYx2fsg7DEnaLFMbyEJR4Adg2mEU0qdheWDO5YhvoS9Z
tHiPwC5D8ZGrP9XI3Mb0XUtN74qN8CLbvgylTk/5YWTYAOIlHf9ZzMviExhwkbPs
Y1RQxjHOHxw0TKD5OjaVqWaEfHD817VFFDjbkUX9jMaOW+Arrzwik4zC4a6h0ef6
6PviqvuRb0DGO7aXw1qXnm0iUh75U7spiKFlrOA0Nd/OoXAoC8iD/E+LOcoe0mNR
N7hPPd1ejqny6suBlOiLNCwQ9jlkGnYkyywkl5suZOKw/KNee9TW1ADhgmpkqhzQ
1vK1YL4syTC8wm+w9MG4xDyh+sNL0hY9z5jfAzfdl/hycUkxORxPLst6lEyYz/97
yhWQ8P7j2MzQ3j9q0x3c6Kkb7f9c6a0YLWS3glHAdGTADnGSXXFdhmvAplRWhgXq
zS1FQNMQsQ61CUvu2t302lUucdIAFrB9ZYOHnR1nllO7gVvIPTrGphwQTNzFnPmo
/D/a6GERTF/btw0bWj2S
=ZPHv
-----END PGP SIGNATURE-----

--to1uSGBmQtEag2WO--



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