Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2588756ybh; Mon, 9 Mar 2020 08:54:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsfHhNyYlfysEZ7vXjcYu9YBWqfmqZMY7pALudB70aa8fvpLm6UUxJ82wExeQrmiadeCYae X-Received: by 2002:a9d:53c4:: with SMTP id i4mr14166867oth.48.1583769240890; Mon, 09 Mar 2020 08:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583769240; cv=none; d=google.com; s=arc-20160816; b=BXfDExNwUiO3//P3Mcc/GSGCiiE5aXLToEP/FbPuLEAzVptWgVWpG9qEDIcJc26jZo JA3aaVF6RmbXNNga+P7M14kK/gOn5KGb6vFmvJ1m4E+OinsemAO8gHXpG9XmNxJDaQ0q /TyS/vodsrLmZgswXvaFNjdEBqLPGyqYmuoiog9I8BAoVg1fe5Nl2apeHhD7S20bg7N3 BdMUPRYhpCqOwoTETVi+JsbbvYzpFiid56oqTHEUt+kSfkzgY5PkZ38Xq8V+L/b6AbfY m3dtc9wnsrurrtPkCWgx27rLh5ghpQnA7K9/noe0aaH/ez05YFA/ZTUp2vlzIO4OrLXX /6/g== 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=EXfBgHukxBvsUIUUHVjFpSxz9MtCVwuKfkDGjmbjA74=; b=oDrS28DqlpJ3hftS1KsNLfN9l1EoSXxiaosHRvteinCf5knFmMo4ILEIc5Ntw2lGLh OFgCNdW4ghByrQSHpxtcntNyYRIPn/ntD4Hmqx6tG0ZfV7KN3OQCVhaGjyPZrwfaGXDa hM2PjhyBvxzDWrU5ZLMFGHOw57o0hBi7AdwT7HxrMPTFdJSqsTvbq5Xkto+wTMbPRU4C 6kZTmBqxtFIeHXFHLfx1l+gvVVyrTOmGKE4ZoiRgjmP24dU8sWf+Mhcv/Kq2XitgBApb h87q9RNIITrEv50gZH0bYN9CHs6lS0o2H0kIbgYtaFOWt+dstBtXdfv7E1K8TF89Fqx9 5ZcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TUfdKwyM; 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 u5si770453otg.42.2020.03.09.08.53.49; Mon, 09 Mar 2020 08:54:00 -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=TUfdKwyM; 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 S1727276AbgCIPxE (ORCPT + 99 others); Mon, 9 Mar 2020 11:53:04 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34510 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbgCIPxD (ORCPT ); Mon, 9 Mar 2020 11:53:03 -0400 Received: by mail-lj1-f195.google.com with SMTP id s13so1274550ljm.1 for ; Mon, 09 Mar 2020 08:53:01 -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=EXfBgHukxBvsUIUUHVjFpSxz9MtCVwuKfkDGjmbjA74=; b=TUfdKwyMIdzZABuGfaz29jdL4jBWhfe9EDROAoWo7k6cs3dhd+ODiA8Fuv0zwjS7aR kaKK1YDIK5c5LCpnpOC9idRXWgQRLP0+CSXvTrz1Mfum6aCAyVhgPh163mCqXrvVGstE th+lI57YSlrxDwtOGDYLNp/qugF7/3vQm9KV4= 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=EXfBgHukxBvsUIUUHVjFpSxz9MtCVwuKfkDGjmbjA74=; b=kES7Fojmeejgjo3DA5xAGThAHj7XsYN5WezM7MSvNSv9+TMYznfuHaOmMHTHUkT8wg WpSY90VJwE7jFdxNG95csqEkIXYkRI384CwconONcky7IuJFdamfVHWsyE/4MeLggGZX J6WQgiYc6a6CdmjAZsVKJ8c5yYaH4/p9lZ9AzmZd+DiYTa+Iwg2r/liZUYsJY+6A644/ YsAPNgzrasPoY/+uAuD9f81ejM2y2z93/UcFz2LFCG3+/uEhlMYWpEc7Q0v2rJhcMSNP NDLsC5ts8/X1jc6+ZQnLXrxcBbauh3TGhNR7rtenNcRc0a3qILUCj1NKgkYVTdqRRZf7 jM+A== X-Gm-Message-State: ANhLgQ3+AGM0+SjU5L6E7mmAHLxie7Hx+kwU3KgzhtnsywxUA0134LtH mF6iVPkrp6X+fgL9w4yGBwp4mOstP48= X-Received: by 2002:a05:651c:201d:: with SMTP id s29mr4035841ljo.240.1583769180356; Mon, 09 Mar 2020 08:53:00 -0700 (PDT) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id x23sm8433088ljj.8.2020.03.09.08.52.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Mar 2020 08:52:58 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id w1so10495106ljh.5 for ; Mon, 09 Mar 2020 08:52:57 -0700 (PDT) X-Received: by 2002:a2e:5850:: with SMTP id x16mr9457422ljd.209.1583769177624; Mon, 09 Mar 2020 08:52:57 -0700 (PDT) MIME-Version: 1.0 References: <20200308140314.GQ5972@shao2-debian> In-Reply-To: From: Linus Torvalds Date: Mon, 9 Mar 2020 08:52:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [locks] 6d390e4b5d: will-it-scale.per_process_ops -96.6% regression To: Jeff Layton Cc: kernel test robot , yangerkun , LKML , lkp@lists.01.org, Neil Brown , Bruce Fields , Al Viro Content-Type: multipart/mixed; boundary="0000000000003d346305a06dff90" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000003d346305a06dff90 Content-Type: text/plain; charset="UTF-8" On Mon, Mar 9, 2020 at 7:36 AM Jeff Layton wrote: > > On Sun, 2020-03-08 at 22:03 +0800, kernel test robot wrote: > > > > FYI, we noticed a -96.6% regression of will-it-scale.per_process_ops due to commit: > > This is not completely unexpected as we're banging on the global > blocked_lock_lock now for every unlock. This test just thrashes file > locks and unlocks without doing anything in between, so the workload > looks pretty artificial [1]. > > It would be nice to avoid the global lock in this codepath, but it > doesn't look simple to do. I'll keep thinking about it, but for now I'm > inclined to ignore this result unless we see a problem in more realistic > workloads. That is a _huge_ regression, though. What about something like the attached? Wouldn't that work? And make the code actually match the old comment about wow "fl_blocker" being NULL being special. The old code seemed to not know about things like memory ordering either. Patch is entirely untested, but aims to have that "smp_store_release() means I'm done and not going to touch it any more", making that smp_load_acquire() test hopefully be valid as per the comment.. Hmm? Linus --0000000000003d346305a06dff90 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k7kn615a0 IGZzL2xvY2tzLmMgfCAyOSArKysrKysrKysrKysrKysrKysrKysrKysrKysrLQogMSBmaWxlIGNo YW5nZWQsIDI4IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS9mcy9s b2Nrcy5jIGIvZnMvbG9ja3MuYwppbmRleCA0MjZiNTVkMzMzZDUuLmJjNWNh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