Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Dec 2010 16:24:59 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Andriy Gapon <avg@freebsd.org>
Subject:   Re: atomic_set_xxx(&x, 0)
Message-ID:  <201012071624.59648.jhb@freebsd.org>
In-Reply-To: <4CFE75D3.4050009@freebsd.org>
References:  <4CFE75D3.4050009@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, December 07, 2010 12:58:43 pm Andriy Gapon wrote:
> 
> $ glimpse atomic_set_ | fgrep -w 0
> /usr/src/sys/dev/arcmsr/arcmsr.c:       atomic_set_int(&acb->srboutstandingcount, 0);
> /usr/src/sys/dev/arcmsr/arcmsr.c:       atomic_set_int(&acb->srboutstandingcount, 0);
> /usr/src/sys/dev/jme/if_jme.c:  atomic_set_int(&sc->jme_morework, 0);
> /usr/src/sys/dev/jme/if_jme.c:  atomic_set_int(&sc->jme_morework, 0);
> /usr/src/sys/dev/ale/if_ale.c:  atomic_set_int(&sc->ale_morework, 0);
> /usr/src/sys/mips/rmi/dev/xlr/rge.c:
> atomic_set_int(&(priv->frin_to_be_sent[i]), 0);
> /usr/src/sys/dev/drm/drm_irq.c:
> atomic_set_rel_32(&dev->vblank[i].count, 0);
> /usr/src/sys/dev/cxgb/ulp/tom/cxgb_tom.c:       atomic_set_int(&t->tids_in_use, 0);
> 
> I wonder if these are all bugs and atomic_store_xxx() was actually intended?

They are most likely bugs.  You can probably ask yongari@ about jme(4) and
ale(4) and np@ about cxgb(4).  drm_irq looks to want to be an atomic_store_rel().
Not sure who to ask about arcmsr(4).  I'm not sure arcmsr(4) really needs the
atomic ops at all, but it should be using atomic_fetchadd() and
atomic_readandclear() instead of some of the current atomic ops.

-- 
John Baldwin



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