Re: MEXT_IS_REF broken.

2000-12-13 Thread Garrett Wollman
< said: > Gee, this looks suspiciously like jhb's refcount patch: ...Except that I made provision for architectures which have LL/SC rather than CAS, which saves a few instructions. -GAWollman To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the me

Re: MEXT_IS_REF broken.

2000-12-12 Thread Jonathan Lemon
In article [EMAIL PROTECTED]> you write: ><<[EMAIL PROTECTED]> said: > >> Actually, in truth I think you can get the code right like so: > >> long x = _mmm->m_ext.ref_cnt->refcnt; >> while (!atomic_cmpset_long(&_mmm->m_ext.ref_cnt->refcnt, x - 1, x)) >> ; > >Cool! You've just (almost) reinv

Re: MEXT_IS_REF broken.

2000-12-12 Thread Jason Evans
On Tue, Dec 12, 2000 at 07:44:36PM -0800, Alfred Perlstein wrote: > Ok, can you please commit the fix then? Bosko is currently working up a patch that should be committed tonight sometime. By the way, thanks for the bug report. =) Jason To Unsubscribe: send mail to [EMAIL PROTECTED] with "uns

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* Garrett Wollman <[EMAIL PROTECTED]> [001212 18:50] wrote: > < said: > > > Actually, in truth I think you can get the code right like so: > > > long x = _mmm->m_ext.ref_cnt->refcnt; > > while (!atomic_cmpset_long(&_mmm->m_ext.ref_cnt->refcnt, x - 1, x)) > > ; > > Cool! You've just (almost

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* Jason Evans <[EMAIL PROTECTED]> [001212 18:39] wrote: > On Tue, Dec 12, 2000 at 05:59:37PM -0800, Alfred Perlstein wrote: > > * Jason Evans <[EMAIL PROTECTED]> [001212 14:32] wrote: > > > A safe version: > > > --- > > > #def

Re: MEXT_IS_REF broken.

2000-12-12 Thread Garrett Wollman
< said: > Actually, in truth I think you can get the code right like so: > long x = _mmm->m_ext.ref_cnt->refcnt; > while (!atomic_cmpset_long(&_mmm->m_ext.ref_cnt->refcnt, x - 1, x)) > ; Cool! You've just (almost) reinvented non-blocking parallel reference-counts. Of course, what you re

Re: MEXT_IS_REF broken.

2000-12-12 Thread Jason Evans
On Tue, Dec 12, 2000 at 05:59:37PM -0800, Alfred Perlstein wrote: > And since Chuck backs me up on this, can we consider this discussion > over as soon as John commits his code? No. Jason To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message

Re: MEXT_IS_REF broken.

2000-12-12 Thread Bosko Milekic
On Tue, 12 Dec 2000, Alfred Perlstein wrote: [...] > And since Chuck backs me up on this, can we consider this discussion > over as soon as John commits his code? I think this is a valid point. This is not the first time the need for proper refcount "interface" arises, or at

Re: MEXT_IS_REF broken.

2000-12-12 Thread Jason Evans
On Tue, Dec 12, 2000 at 05:59:37PM -0800, Alfred Perlstein wrote: > * Jason Evans <[EMAIL PROTECTED]> [001212 14:32] wrote: > > A safe version: > > --- > > #define MEXTFREE(m) do {

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* John Baldwin <[EMAIL PROTECTED]> [001212 15:19] wrote: > > On 12-Dec-00 Julian Elischer wrote: > > John Baldwin wrote: > >> > >> On 12-Dec-00 Alfred Perlstein wrote: > >> > grr... > >> > > >> > considering this: > >> > > >> >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > >> > > >> >

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* Jason Evans <[EMAIL PROTECTED]> [001212 14:32] wrote: > On Tue, Dec 12, 2000 at 01:51:00AM -0800, Alfred Perlstein wrote: > > A safe version: > --- > #define MEXTFREE(m) do {

Re: MEXT_IS_REF broken.

2000-12-12 Thread John Baldwin
On 12-Dec-00 Julian Elischer wrote: > John Baldwin wrote: >> >> On 12-Dec-00 Alfred Perlstein wrote: >> > grr... >> > >> > considering this: >> > >> >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) >> > >> >#define MEXT_REM_REF(m) do {\ >> > KASSERT((m)->m_ext

Re: MEXT_IS_REF broken.

2000-12-12 Thread John Baldwin
On 12-Dec-00 Jason Evans wrote: > On Tue, Dec 12, 2000 at 01:51:00AM -0800, Alfred Perlstein wrote: >> * Alfred Perlstein <[EMAIL PROTECTED]> [001212 01:44] wrote: >> > grr... >> > >> > considering this: >> > >> > #define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) >> > >> > #define MEXT_R

Re: MEXT_IS_REF broken.

2000-12-12 Thread Jason Evans
On Tue, Dec 12, 2000 at 01:51:00AM -0800, Alfred Perlstein wrote: > * Alfred Perlstein <[EMAIL PROTECTED]> [001212 01:44] wrote: > > grr... > > > > considering this: > > > > #define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > > > > #define MEXT_REM_REF(m) do {\ > >

Re: MEXT_IS_REF broken.

2000-12-12 Thread Julian Elischer
John Baldwin wrote: > > On 12-Dec-00 Alfred Perlstein wrote: > > grr... > > > > considering this: > > > >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > > > >#define MEXT_REM_REF(m) do {\ > > KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \ >

Re: MEXT_IS_REF broken.

2000-12-12 Thread John Baldwin
On 12-Dec-00 Alfred Perlstein wrote: > * John Baldwin <[EMAIL PROTECTED]> [001212 08:39] wrote: >> >> On 12-Dec-00 Alfred Perlstein wrote: >> > grr... >> > >> > considering this: >> > >> >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) >> > >> >#define MEXT_REM_REF(m) do {

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* John Baldwin <[EMAIL PROTECTED]> [001212 08:39] wrote: > > On 12-Dec-00 Alfred Perlstein wrote: > > grr... > > > > considering this: > > > >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > > > >#define MEXT_REM_REF(m) do {\ > > KASSERT((m)->m_ext.ref_cnt-

RE: MEXT_IS_REF broken.

2000-12-12 Thread John Baldwin
On 12-Dec-00 Alfred Perlstein wrote: > grr... > > considering this: > >#define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > >#define MEXT_REM_REF(m) do {\ > KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \ > atomic_subtract_long(&((m)->m_ex

Re: MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
* Alfred Perlstein <[EMAIL PROTECTED]> [001212 01:44] wrote: > grr... > > considering this: > > #define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) > > #define MEXT_REM_REF(m) do {\ > KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \ > atomic_

MEXT_IS_REF broken.

2000-12-12 Thread Alfred Perlstein
grr... considering this: #define MEXT_IS_REF(m) ((m)->m_ext.ref_cnt->refcnt > 1) #define MEXT_REM_REF(m) do {\ KASSERT((m)->m_ext.ref_cnt->refcnt > 0, ("m_ext refcnt < 0")); \ atomic_subtract_long(&((m)->m_ext.ref_cnt->refcnt), 1); \ } while(0) this: #defi