bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Aren't spinlocks missing a memory clobber? [Was: ext2fs crashes lately]


From: Samuel Thibault
Subject: Aren't spinlocks missing a memory clobber? [Was: ext2fs crashes lately]
Date: Sat, 2 Aug 2008 02:22:05 +0100
User-agent: Mutt/1.5.12-2006-07-14

Barry deFreese, le Thu 24 Jul 2008 22:19:16 -0400, a écrit :
> ext2fs.static: 
> /var/tmp/hurd-20071119/build-tree/hurd/libports/port-ref.c:31:ports_port_ref: 
> Assertion 'pi->refcnt || pi->weakrefcnt' failed.

Quite odd.

I had a closer look at the locking functions, and I noticed that
spin_*lock() functions do not have a "memory" clobber.  In my
understanding of gcc's behavior, that lets it move memory operations
outside the critical section, even with the volatile qualifier (which
just means that the assembly part shouldn't be optimized away).  At
least in all other spinlock implementations I know there is such
clobber.

That could very well explain the oddity above (as well as other random
things happening from times to times).

Samuel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]