svn commit: r196226 - in head/sys: kern sys

Attilio Rao attilio at
Sat Aug 15 03:01:04 UTC 2009

2009/8/14 Bjoern A. Zeeb <bz at>:
> Author: bz
> Date: Fri Aug 14 21:46:54 2009
> New Revision: 196226
> URL:
> Log:
>  Add a new macro to test that a variable could be loaded atomically.
>  Check that the given variable is at most uintptr_t in size and that
>  it is aligned.
>  Note: ASSERT_ATOMIC_LOAD() uses ALIGN() to check for adequate
>        alignment -- however, the function of ALIGN() is to guarantee
>        alignment, and therefore may lead to stronger alignment
>        enforcement than necessary for types that are smaller than
>        sizeof(uintptr_t).
>  Add checks to mtx, rw and sx locks init functions to detect possible
>  breakage. This was used during debugging of the problem fixed with
>  r196118 where a pointer was on an un-aligned address in the dpcpu area.
>  In collaboration with:        rwatson
>  Reviewed by:          rwatson
>  Approved by:          re (kib)
> Modified:
>  head/sys/kern/kern_mutex.c
>  head/sys/kern/kern_rwlock.c
>  head/sys/kern/kern_sx.c
>  head/sys/sys/systm.h

I think you should cover the lockmgr case too.


Peace can only be achieved by understanding - A. Einstein

More information about the svn-src-all mailing list