From owner-svn-src-head@freebsd.org Thu Jul 30 15:47:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 664219AE532; Thu, 30 Jul 2015 15:47:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F8D1660; Thu, 30 Jul 2015 15:47:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6UFlt0Y099638; Thu, 30 Jul 2015 15:47:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6UFlsJx099636; Thu, 30 Jul 2015 15:47:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507301547.t6UFlsJx099636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Jul 2015 15:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286078 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2015 15:47:55 -0000 Author: kib Date: Thu Jul 30 15:47:53 2015 New Revision: 286078 URL: https://svnweb.freebsd.org/changeset/base/286078 Log: Improve comments. Submitted by: bde MFC after: 2 weeks Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Thu Jul 30 15:43:26 2015 (r286077) +++ head/sys/amd64/include/atomic.h Thu Jul 30 15:47:53 2015 (r286078) @@ -272,10 +272,10 @@ atomic_testandset_long(volatile u_long * * addresses, so we need a Store/Load barrier for sequentially * consistent fences in SMP kernels. We use "lock addl $0,mem" for a * Store/Load barrier, as recommended by the AMD Software Optimization - * Guide, and not mfence. In the kernel, we use a private per-cpu - * cache line as the target for the locked addition, to avoid - * introducing false data dependencies. In user space, we use a word - * in the stack's red zone (-8(%rsp)). + * Guide, and not mfence. To avoid false data dependencies, we use a + * special address for "mem". In the kernel, we use a private per-cpu + * cache line. In user space, we use a word in the stack's red zone + * (-8(%rsp)). * * For UP kernels, however, the memory of the single processor is * always consistent, so we only need to stop the compiler from Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Thu Jul 30 15:43:26 2015 (r286077) +++ head/sys/i386/include/atomic.h Thu Jul 30 15:47:53 2015 (r286078) @@ -259,9 +259,9 @@ atomic_testandset_int(volatile u_int *p, * consistent fences in SMP kernels. We use "lock addl $0,mem" for a * Store/Load barrier, as recommended by the AMD Software Optimization * Guide, and not mfence. In the kernel, we use a private per-cpu - * cache line as the target for the locked addition, to avoid - * introducing false data dependencies. In userspace, a word at the - * top of the stack is utilized. + * cache line for "mem", to avoid introducing false data + * dependencies. In user space, we use the word at the top of the + * stack. * * For UP kernels, however, the memory of the single processor is * always consistent, so we only need to stop the compiler from