From owner-cvs-src@FreeBSD.ORG Thu Oct 16 15:11:46 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A73D16A4B3; Thu, 16 Oct 2003 15:11:46 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8E7A43F85; Thu, 16 Oct 2003 15:11:44 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id h9GMBZ49055346; Fri, 17 Oct 2003 00:11:41 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 16 Oct 2003 21:16:17 +1000." <20031016210328.T930@gamplex.bde.org> Date: Fri, 17 Oct 2003 00:11:35 +0200 Message-ID: <55345.1066342295@critter.freebsd.dk> cc: cvs-src@FreeBSD.org cc: Doug Rabson cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys bus.h kobj.h param.h src/sys/kern subr_bus.c subr_kobj.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2003 22:11:46 -0000 In message <20031016210328.T930@gamplex.bde.org>, Bruce Evans writes: >> * 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_(). "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. "" is part of a >bad API. There are _so_ many things which explode if this assumption does not hold that I think doing anything but gold-plating it would be a total waste of time. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.