Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1103085ybh; Wed, 11 Mar 2020 17:40:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvZxbcSCyMgiIkwwNuMEpjBh1q5DDohVRe5fukZwsZ3w0j8gdQ9ZFBipArYFdef6L2Yh4oc X-Received: by 2002:a4a:d79a:: with SMTP id c26mr2173264oou.60.1583973607144; Wed, 11 Mar 2020 17:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583973607; cv=none; d=google.com; s=arc-20160816; b=stzKPHP/P2iJ19x+rOS+74u2S45dn3I1f/gSKOPJqxSC9znvJxgxn4YX9Fude6/MAO oURLdWbVf0cJGxu2lmbAILjIV0IChIkmI3Cxamuoe4/tZ6MHrKkqz9Fh8FbIP5+0vUH7 8EKNSR2mwuzaOQT4G6RrdTvdtGQk8SdcjjHVjR/R2gx+LcEs4RD4qP2nu+UqpAWhkHuP RnhyBfPNwR9ioj2aldQUTzEAZVcbRQVXcK69ZdSUAaHcqaXGp/AA6ApLTpX85HSJ8yf6 aYJBBmQpQ7iNs4ZEFU1YnglzX0perXjVRsmKZ2Oq5rPVV70tRej8Skshga9BlPIyeVhn dcyg== 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=bLKsPDUE1GSvDBpqdETPjKLJMVmpkRahrPwuhoHrW/Q=; b=ya229TDalZTfXoQ8j9FAG/h2aUJIODDzwzIScUMGNgi11jK014EJZMmIY6qFvYs1Ah eAiUF+pRQ1Lwa4S8667+qtgYirnIZdYAq4KukDPCPNdzNfCWpabsOi85thbl8VrwWDow cPuNKh9fkhctlJ80VFxEY986xwoDzzuVXY0HBNiSqZz9u5d5hk1cGEcGJ4Jp5BEgcRAJ vOsp/oCyp0DWywRfNTN2UhSvIFPlDBDSo1gfpEGEZb6cLwTTSQAXse8rlIRSI5xi4Vvq 0JpSELQGTuballnWHbK9BnNS+3mskOluAXsXhWxNBaSmI0TOw2zUWeJFYpjYprGFFJ8+ ZCSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="aWiKx0/F"; 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 e22si893936oob.87.2020.03.11.17.39.55; Wed, 11 Mar 2020 17:40:07 -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="aWiKx0/F"; 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 S2387411AbgCLAif (ORCPT + 99 others); Wed, 11 Mar 2020 20:38:35 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36971 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731476AbgCLAie (ORCPT ); Wed, 11 Mar 2020 20:38:34 -0400 Received: by mail-lj1-f193.google.com with SMTP id r24so4433131ljd.4 for ; Wed, 11 Mar 2020 17:38:33 -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=bLKsPDUE1GSvDBpqdETPjKLJMVmpkRahrPwuhoHrW/Q=; b=aWiKx0/Fl3mcmfdqhjXRNIjpIXRXQA9lXQuH4XULt8QTL2rBWyhdbifyR+qeKRaNoI x0Hxy1YTXIwg5BI6xuZDajLdVT9NfgEGBc8lPciBykJqj2ZTl9wIKY+kgOBsd5Ut6QBk rDMVJkdtREVZ9sdyt6WJK5wZ306w1GTPToDjU= 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=bLKsPDUE1GSvDBpqdETPjKLJMVmpkRahrPwuhoHrW/Q=; b=XGi+mXfDhO73pGfPx6CasxHzWFtY5htb4yRvplZToynWRIXJ/P2L1Sowprx7IcKYQ9 uNMNubhsBn2Ov74NoYLJIamV0/RcrrzyG7MpuvPEo9oj8o0gNELxAtklFj/5+RdoMQF1 1uWAvBKvqeIJ8GEwzJw7woXP2QTsDQ/hvlFE+4P6HoPWPPkmVOmuQQk8U5SLD4ctw2Mu nbTvQhFsiGnBvH4HrBFdZCCtpH7zpQoKKBR+lsWO5B50Z8ovtBbuvnDw2alxcgrJi83y kF0dbZBeQQzWPHxaiHk+Jdm7ZVlmtP+d45GoLHSSOjwgR3X90ezUgsTY8WHC2yGTiLR1 udaA== X-Gm-Message-State: ANhLgQ2zYEIEn5Kya17D5ze+Egt5kdHjQf9+8zkoKifBmHlsmtYO5hVM USrbPmd9dLbWIUcv1O7IOKOKK4P0C8g= X-Received: by 2002:a2e:b88d:: with SMTP id r13mr3331024ljp.66.1583973512002; Wed, 11 Mar 2020 17:38:32 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id p133sm9992283lfa.82.2020.03.11.17.38.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Mar 2020 17:38:30 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id w1so4433889ljh.5 for ; Wed, 11 Mar 2020 17:38:30 -0700 (PDT) X-Received: by 2002:a2e:6819:: with SMTP id c25mr3564744lja.16.1583973510152; Wed, 11 Mar 2020 17:38:30 -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> <0066a9f150a55c13fcc750f6e657deae4ebdef97.camel@kernel.org> <87v9nattul.fsf@notabene.neil.brown.name> In-Reply-To: <87v9nattul.fsf@notabene.neil.brown.name> From: Linus Torvalds Date: Wed, 11 Mar 2020 17:38:14 -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 Wed, Mar 11, 2020 at 3:22 PM NeilBrown wrote: > > We can combine the two ideas - move the list_del_init() later, and still > protect it with the wq locks. This avoids holding the lock across the > callback, but provides clear atomicity guarantees. Ugfh. Honestly, this is disgusting. Now you re-take the same lock in immediate succession for the non-callback case. It's just hidden. And it's not like the list_del_init() _needs_ the lock (it's not currently called with the lock held). So that "hold the lock over list_del_init()" seems to be horrendously bogus. It's only done as a serialization thing for that optimistic case. And that optimistic case doesn't even *want* that kind of serialization. It really just wants a "I'm done" flag. So no. Don't do this. It's mis-using the lock in several ways. Linus