Re: separating out memory checks from INVARIANTS



On Sat, 15 Mar 2008, Jeff Roberson wrote:

On Sat, 15 Mar 2008, Kip Macy wrote:
Would it make it possible to do memory allocation without holding a
lock in the M_NOWAIT case?

Yes, when I originally wrote the code it didn't require a lock because I relied on byte writes being atomic. However, we had platforms for which that wasn't true. (alpha). It may be that it's safe not to lock even now on x86/amd64. I don't know the specifics of the memory architectures on powerpc, arm, mips, etc. though.

sparc64 only supports atomic ops on sizes 32 and 64 bits. I think it
and not alpha was responsible for eliminating use of 8 and 16 bit
atomic ops in MI code.

My version of atomic.h for i386 only supports atomic ops on size 32.
8 and 16 bit atomic ops are not usable in MI code and are or were not
used in i386 MD code, so they are just interface bloat.

Bruce
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: separating out memory checks from INVARIANTS
    ... when I originally wrote the code it didn't require a lock because I relied on byte writes being atomic. ... and not alpha was responsible for eliminating use of 8 and 16 bit ... My version of atomic.h for i386 only supports atomic ops on size 32. ... just a write memory barrier and the ability to write a single byte without affecting surrounding bytes. ...
    (freebsd-arch)
  • Re: sched_lock && thread_lock()
    ... in some cases there is already a lock available that is protecting the counter. ... atomic ops are not used. ... Atomic ops are still strictly needed to give atomic accesses to ... and then races writing. ...
    (freebsd-arch)
  • mfence vs atomic ops
    ... (mfence, lfence, sfence) ... vs atomic ops (lock ...). ...
    (comp.programming.threads)
  • Re: Giantless VFS.
    ... On Tuesday 30 November 2004 01:28 am, Jeff Roberson wrote: ... >> pointer eventually for the name of a lock? ... To unsubscribe, ...
    (freebsd-current)
  • Re: Giantless VFS.
    ... On Tuesday 30 November 2004 01:28 am, Jeff Roberson wrote: ... >> pointer eventually for the name of a lock? ... To unsubscribe, ...
    (freebsd-current)