Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1102917ybh; Tue, 10 Mar 2020 14:48:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuOqyMS5AHYK00GZLKZm+TeIreGvUuOt67xDWCr8qofdec9f5EcDwUBZTN6D5FI+MD1qqqn X-Received: by 2002:a54:4816:: with SMTP id j22mr269689oij.162.1583876904101; Tue, 10 Mar 2020 14:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583876904; cv=none; d=google.com; s=arc-20160816; b=pTuWtg3+PGRXlWAH48kM6tgDcD+GNRekYgWj8UYzpIuc90Cff9NbijwTESC/0vpxpf r/EIMlqnFdqaoDsVvMMV7dZmEchdEIwfhQujEczAXMV6vlPLWy6M04TQwYH4nLtmPD+h zuUE8L/hRwp0D9RUC2TSRFjMU2KaFaDefIIw0SqnbrN96fXpW5GKAq86P2RnYHyF998v HhFnuEaxct1na8+RyGPvVKRi69P1C7nrt03Za6uIzkpnT+g21RzPOeiTXErUtVA2ZTCZ GBK70FAU9KC0h1usdNacfmI6VBLc1EJpsx53QbwB+mNZ7ghnhOIsMMCCrdnLcI9m89IR yVDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+ppVh7LyRFIl1A+ELQ+dNJ6Ueqe7YDWhaCMx5Yyl/CY=; b=Q1rpzpjIuqdfJ+RrEr8IqlAUMdcJpuonXHkQvqB89uOkrziWst7h4k2YerI9tY/Orf uQQ/6ytdGHPQ7fk+FTwpBhj9ru8sjQJS0Ckr7xgU++wmPWPbyauZtkHWM+6PmT9AP3Yz yoqI1ry6w2TNS/1C1nkcfOm53Cii7ZYH2RquCPT5QQwkFkaoNnVCN/X7JY+Lr4bZljs3 0mHsNK5Lr8iK8R7WA2fH0v5wHW6QIloZUdPW6Gb+LXe7daJ0+iWkZCZJ03N7qx/GIZjb ZUanwvd24lk8k1iYzrVahhtGKgP60xb3gtCXzWJDGvnX2SOKzobNVKqez7ABk5UUT4jP eX3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KpyfUwT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si8451188otj.294.2020.03.10.14.48.11; Tue, 10 Mar 2020 14:48:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KpyfUwT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbgCJVr5 (ORCPT + 99 others); Tue, 10 Mar 2020 17:47:57 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42499 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726273AbgCJVr4 (ORCPT ); Tue, 10 Mar 2020 17:47:56 -0400 Received: by mail-lf1-f65.google.com with SMTP id t21so12228116lfe.9 for ; Tue, 10 Mar 2020 14:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+ppVh7LyRFIl1A+ELQ+dNJ6Ueqe7YDWhaCMx5Yyl/CY=; b=KpyfUwT0etYAj8+912O82nlR5HeLTpn4SDsTonOMcnn6Bd+D1ADvt7zQ/ZV6TMQH7k eOHDcGUHKwWB4kmeeO9si7StiS7ATtguh9IW2vUN6FfyLnkrtaG/hLlw/V3tOD6UJ7HC vgQx7S0Yjy+AZ7lit98JPffg4rZ7IJBRwdcDo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+ppVh7LyRFIl1A+ELQ+dNJ6Ueqe7YDWhaCMx5Yyl/CY=; b=ViK+zHGUU9q9wdNvNSlxfZ5vrnuuamnZ6H6AJxXeqRUOSA1JfX0MB4nPPPNrr+r8Iq 28Cq/Au68gaRqdQ+s6i5ZG6pdR06CRpKHb015MEpC2NXmrTMtlJTs9oPzPBWECRF8vaN T2Y2n/6BAcGvqm5eGjQXIJ9Dw5yxdntcWt4DfxSuM7dlT3EFHCgE8Z4eRTi3S3kPgcKo s8yAV2k8DK7tPv05KdbD58cn3XitEz83xy0VSLMkcotu+sqReKalP/zAL5l97HCBzu4/ +IjDt1s1NoqAxQ4Ejl+XUSpZrjmeHLcLZ6ZbwmgPtdHq1x7mazrF80Jv4eZ2bcrwgTk6 wj2g== X-Gm-Message-State: ANhLgQ3OCceaDdCoUDhukgQDhYbnNbALXLhvsB61xrc5QLZKS5O8ooEf n9RQ2Y3Btr2x1Z2ApBqw6GP7NQF2XBo= X-Received: by 2002:a05:6512:202:: with SMTP id a2mr111732lfo.108.1583876872609; Tue, 10 Mar 2020 14:47:52 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id s7sm5962055lfp.51.2020.03.10.14.47.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Mar 2020 14:47:51 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id q10so11495018lfo.8 for ; Tue, 10 Mar 2020 14:47:50 -0700 (PDT) X-Received: by 2002:ac2:5508:: with SMTP id j8mr99474lfk.31.1583876870571; Tue, 10 Mar 2020 14:47:50 -0700 (PDT) MIME-Version: 1.0 References: <20200308140314.GQ5972@shao2-debian> <34355c4fe6c3968b1f619c60d5ff2ca11a313096.camel@kernel.org> <1bfba96b4bf0d3ca9a18a2bced3ef3a2a7b44dad.camel@kernel.org> <87blp5urwq.fsf@notabene.neil.brown.name> <41c83d34ae4c166f48e7969b2b71e43a0f69028d.camel@kernel.org> <923487db2c9396c79f8e8dd4f846b2b1762635c8.camel@kernel.org> <36c58a6d07b67aac751fca27a4938dc1759d9267.camel@kernel.org> <878sk7vs8q.fsf@notabene.neil.brown.name> <875zfbvrbm.fsf@notabene.neil.brown.name> In-Reply-To: <875zfbvrbm.fsf@notabene.neil.brown.name> From: Linus Torvalds Date: Tue, 10 Mar 2020 14:47:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [locks] 6d390e4b5d: will-it-scale.per_process_ops -96.6% regression To: NeilBrown Cc: Jeff Layton , yangerkun , kernel test robot , LKML , lkp@lists.01.org, Bruce Fields , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 2:22 PM NeilBrown wrote: > > A compiler barrier() is probably justified. Memory barriers delay reads > and expedite writes so they cannot be needed. That's not at all guaranteed. Weakly ordered memory things can actually have odd orderings, and not just "writes delayed, reads done early". Reads may be delayed too by cache misses, and memory barriers can thus expedite reads as well (by forcing the missing read to happen before later non-missing ones). So don't assume that a memory barrier would only delay reads and expedite writes. Quite the reverse: assume that there is no ordering at all unless you impose one with a memory barrier (*). Linus (*) it's a bit more complex than that, in that we do assume that control dependencies end up gating writes, for example, but those kinds of implicit ordering things should *not* be what you depend on in the code unless you're doing some seriously subtle memory ordering work and comment on it extensively.