atomic_set_xxx(&x, 0)

John Baldwin jhb at freebsd.org
Tue Dec 7 21:25:16 UTC 2010


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


More information about the freebsd-hackers mailing list