Date: Fri, 22 Jun 2001 15:38:54 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: Matthew Jacob <mjacob@feral.com> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/include atomic.h Message-ID: <XFMail.010622153854.jhb@FreeBSD.org> In-Reply-To: <20010622143210.F20923-100000@wonky.feral.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 22-Jun-01 Matthew Jacob wrote: > > > On Fri, 22 Jun 2001, John Baldwin wrote: > >> >> On 22-Jun-01 Matthew Jacob wrote: >> > >> > >> > Hmm........ Did you decide this might clean up the foo we've been seeing? >> > >> > I believe I *had* mentioned this to you at some point...... >> >> It shouldn't be needed in theory, (theory is great) but it does make the >> weird witness panics go away. > > I thought I mentioned that I thought that the issue here is that you're > mixing > atomic accesses (ldl_c/stX_c) which do not require MB with plain tests (using > loads) which are not guaranteed to be coherent. A linked-load isn't special in comparison to a normal load as far as atomicity is concerned. Actually, look at the example code for getting and releasing a lock on page 5-7 (section 5.5.3) of the brown book. It uses a normal ldq to check the value before even trying the ldq_l and stq_c loop. Then it does an MB after this (which we already do since we use acquire atomic ops to get a lock) then when it is done it uses an MB followed by a normal stq (like our atomic_store_rel) to close the critical section and release the lock. These mb's are not needed, but better safe than sorry for now. In theory, we should be able to rip out all the mb's in the atomic functions and just have the appropriate mb's in the acq and rel versions. > Oh, well... Look- if it makes things better, great! Maybe just put a note to > revisit it again later? Yeah. > -matt -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010622153854.jhb>