From owner-svn-src-all@freebsd.org Fri Apr 26 07:48:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC395158C312; Fri, 26 Apr 2019 07:48:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7800B87CC2; Fri, 26 Apr 2019 07:48:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg1-x52a.google.com with SMTP id y27so479012pgl.12; Fri, 26 Apr 2019 00:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UhBLQixYGEk4j66mPYcoVX/cDmK4Flg8GblaXXSBIuc=; b=oRbU1+AKiV/ye84/wLeV6zinltbLu98r1j+AX3FdA9ULYqlAZ8u5mq6+tsmhLfJQZp Ohmb07egi6k8B2v5XK9tCFfW3bbg+5OKnzrib+NWglubDdKeq/8hDuax16kuEw4yI6FT OiWwfcQkJc/9WNFBY6x4MkIVJ4f/jhK1yZiYZNQLkMiHulpeYwoN/3HzwdvSJHKPDWhq bafHwVvj1qZdP/amNUxx4r4F0pIL2KGgOgWwjf5MokgoVMfy4XZA6yR0ZqweMWof4jgV PfDrZ8GOCHmXhs1MTc6mMw/kPaZLGGuvPVHxlMKJ9VUY5jy6xkxTEuYq4IZVG5qw8iO+ 9ZZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=UhBLQixYGEk4j66mPYcoVX/cDmK4Flg8GblaXXSBIuc=; b=cpIV3Wa7zeDOEO58j+rCyqoXnKbmZ5FLnFUIxIaY52tIMYqZodbUEjucruILjuByST S1P5p12HaEOMFbnWOFo0Q2bNfTa7z43WdI6L2tDfdXWBi6UkM79KCRtMVAFVQUGl/oej rdmo5amnd86SYEeQouNP/2sVu3v8hbcn8NQmlB/UwdwDTHDuf+hbWn8JUByDq9f8XDqG 9Pj465jGxPEUgVDvawb+6ZeB+TFG5CJWx8/4S3mNQAtk39wfAB65/MSmJ1oTwbHbDGeI e85T5Skb/ClYYdWOk1RwBepNy+fKX4HjPSCJxm3Bn6jorz8FUS9ygbI50AXdA1lxX+Xz Ssvg== X-Gm-Message-State: APjAAAVC24MZGc7qM99Kt7Qy21XJspcbjmCcTOldN5lidMW3z39Td127 wFA+rVDMU7d1RAwfNEQUJ2A= X-Google-Smtp-Source: APXvYqxhzCNBKNAE12RWNwiKta6CyKkoD5Kj+qh+QHwhXet2IeWhcDFKLjoXgQiBvS5m6HagHEWQMw== X-Received: by 2002:a65:6659:: with SMTP id z25mr41823227pgv.10.1556264889163; Fri, 26 Apr 2019 00:48:09 -0700 (PDT) Received: from spy ([180.217.236.228]) by smtp.gmail.com with ESMTPSA id b13sm33965350pfd.12.2019.04.26.00.48.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 00:48:07 -0700 (PDT) Sender: Mark Johnston Date: Fri, 26 Apr 2019 03:47:59 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Wojciech Macek , Wojciech Macek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346593 - head/sys/sys Message-ID: <20190426074759.GA2695@spy> References: <201904230636.x3N6aWQK057863@repo.freebsd.org> <20190425040817.GA3789@spy> <20190425082222.GJ12936@kib.kiev.ua> <20190426060456.GA59853@spy> <20190426073836.GP12936@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426073836.GP12936@kib.kiev.ua> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 7800B87CC2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2019 07:48:11 -0000 On Fri, Apr 26, 2019 at 10:38:36AM +0300, Konstantin Belousov wrote: > On Fri, Apr 26, 2019 at 02:04:56AM -0400, Mark Johnston wrote: > > On Thu, Apr 25, 2019 at 11:22:22AM +0300, Konstantin Belousov wrote: > > > On Thu, Apr 25, 2019 at 07:38:21AM +0200, Wojciech Macek wrote: > > > > Intel does not reorder reads against the condition "if" here. I know for > > > > sure that ARM does, but therestill might be some other architectures that > > > > also suffers such behavior - I just don't have any means to verify. > > > > I remember the discussion for rS302292 where we agreed that this kind of > > > > patches should be the least impacting in perfomrance as possible. Adding > > > > unconditional memory barrier causes significant performance drop on Intel, > > > > where in fact, the issue was never seen. > > > > > > > Atomic_thread_fence_acq() is nop on x86, or rather, it is compiler memory > > > barrier. If you need read/read fence on some architectures, I am sure > > > that you need compiler barrier on all. > > > > To add a bit, one reason to prefer atomic(9) to explicit fences is > > precisely because it issues fences only when required by a given > > CPU architecture. There is no "unconditional memory barrier" added by > > the diff even without the #ifdef. > Well, atomic_thread_fence_acq() is the explicit fence. And on x86 it > does add unconditional compiler memory barrier. I only mean that with atomic_thread_fence_acq() on x86, the CPU does not see any fences. Based on the original commit it seems that a compiler barrier is required on all platforms, at a minimum.