cvs commit: src/sys/sys bus.h kobj.h param.h src/sys/kern subr_bus.c subr_kobj.c

Bruce Evans bde at zeta.org.au
Thu Oct 16 04:17:44 PDT 2003


On Thu, 16 Oct 2003, Doug Rabson wrote:

> dfr         2003/10/16 02:16:28 PDT
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/sys              bus.h kobj.h param.h
>     sys/kern             subr_bus.c subr_kobj.c
>   Log:
>   * Add multiple inheritance to kobj. Each class can have zero or more base
>     ...
>   * Change the kobj method lookup algorithm to one which is SMP-safe. This
>     relies only on the constraint that an observer of a sequence of writes
>     of pointer-sized values will see exactly one of those values, not a
>     mixture of two or more values. This assumption holds for all processors
>     which FreeBSD supports.

This assumption should be avoided by using atomic_load() (and
atomic_store_mumble()).  See a discussion of "atomicity of unlocked
reads" last month.  First implement atomic_load().  There is currently
only atomic_load_acq_<type>().  "acq" gives acquire semantics which
is more than what is needed here and our implementations may do more
than what is required anyway for some arches.  "<type>" is part of a
bad API.

Bruce


More information about the cvs-src mailing list