Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1135540ybh; Tue, 10 Mar 2020 15:33:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvevnodCso4F0W5x7TA/zXxeBmeKq85gLJEpJMVrGKN7cnBetrOvHHVD4tLfRcRILuwsVlH X-Received: by 2002:a9d:336:: with SMTP id 51mr4460otv.202.1583879595214; Tue, 10 Mar 2020 15:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583879595; cv=none; d=google.com; s=arc-20160816; b=gvC/noxnD+oD8JeHGBKYCqEgDSKl31Bmg8dGZdNetCLzqFIdYMLvVgYE372CG7noYi bSBBuOohdIv2JemRbqG4YW0YrA2YA1zg94AYWgCZ2wi8Z6BZDkLaTSWbBQWwlwVykhVp aVl6/XnV23An3F/wZ8Hua+kLtFCPxAEh7JMg95trm6DSCZAj29ivnpa8eRMBpNtHoSUF rSXnKWOfqfwcP245I6Q5abDNrK9zIw/dHLDiWVwCEK+y+QW20eLJwPGruyiuxzxdcZ2y k2SvL0UAD87Dlazx9ufmGvW1fOQIZxY5trFCU6HQPStcW5cN+RzXgtv6C6dS5UTy/OzA 5OHQ== 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=cRzFDMWVFAVW4g21VSZ2BZmn8vOI4KiazeKxqVX5u1M=; b=gtKmszpAFSn5freLnfM8TfSrzCWPvC4SIWqk4be0arKvJljBDEr1JO/SwSZC/qbxjW roJc5Y2ThsVfHZzE7vizTdrOjvpVohpTXr/19iX8PlQ51jrxpJgZTN79IloCctrHXaER z6e80smbGSIYEj1AsJ08hdQeWutlnZc0qfMXf0LouNNIMhR1OhmSS/D3lIr84mxp2R8B vOyvCnPqEuvNfVmVz5JSb5AAGK1Ww/ppjB046iB3mZVRQjeqad3Dwx+2OoVCM0V2eG83 UdxbmBjZhskOfbX+Z9xRIiljOm/StNi3f9XFhXaBf5e3vvmKjjiIIaDHeZ1HakHjHKM8 C2bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U3r0UrKX; 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 v22si31264otq.109.2020.03.10.15.33.02; Tue, 10 Mar 2020 15:33:15 -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=U3r0UrKX; 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 S1727728AbgCJWbd (ORCPT + 99 others); Tue, 10 Mar 2020 18:31:33 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42546 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgCJWbd (ORCPT ); Tue, 10 Mar 2020 18:31:33 -0400 Received: by mail-lf1-f66.google.com with SMTP id t21so12313966lfe.9 for ; Tue, 10 Mar 2020 15:31:30 -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=cRzFDMWVFAVW4g21VSZ2BZmn8vOI4KiazeKxqVX5u1M=; b=U3r0UrKX6PpyZ4UFRD1frE5J1x+pHwGop7H4CtDm8VEhXvpGaQKTaPU7hqrv9eUVcg sBiNBF7mZoDTWUjiPW3TYHFgpIRzw9h0sFKsRtexWHe9y0tSObM4tGw+sRYYPqfdFqY7 fQANRaStPwMQNZIfgu6bwlvlAR81omWYDfZks= 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=cRzFDMWVFAVW4g21VSZ2BZmn8vOI4KiazeKxqVX5u1M=; b=pqMsiy77+jNIDCCMlQa4kNOjNJLKFBPxT+ZBp0nhlbQ9f1j1qFh3ASZAVJzk81mX8w 8Rgaq1BcYxybpwO15x1p1R7rF8FcF/cPk+EJeAJChOZQt/aZK6phsOWblCY9UNaNd713 dzfM6B1eYegQOTWf/lMqOlBWSLdXN7PGVbOlckQzbxa/JQQ7zy7aPdUPiGNXWweRpAZt ylOjqjXVU2IqRJgCPu1+6Rm2/SY4EPyJN6ecTGu+H21a2BehQ4DqRj1mGZli85vua4BS RJg7z7cbIOoJOJVEmSaZwVfA2BQgi8IMdHbEJp89hfwm4jV8ThhrRxEmKkad+9Aoi2Ke p20w== X-Gm-Message-State: ANhLgQ0fUn7oftyqtw0yDT8OvIybIG9Y1j7MuWpDnSkU5h7HzcqtN02F a4TJ04NeVRD5u+v8GH2DduvCiuXGRBw= X-Received: by 2002:ac2:4145:: with SMTP id c5mr172590lfi.71.1583879488525; Tue, 10 Mar 2020 15:31:28 -0700 (PDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id d4sm224010lfa.75.2020.03.10.15.31.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Mar 2020 15:31:27 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id f13so126534ljp.0 for ; Tue, 10 Mar 2020 15:31:26 -0700 (PDT) X-Received: by 2002:a2e:6819:: with SMTP id c25mr246698lja.16.1583879486442; Tue, 10 Mar 2020 15:31:26 -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> In-Reply-To: <0066a9f150a55c13fcc750f6e657deae4ebdef97.camel@kernel.org> From: Linus Torvalds Date: Tue, 10 Mar 2020 15:31:10 -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: NeilBrown , 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 3:07 PM Jeff Layton wrote: > > Given that, and the fact that Neil pointed out that yangerkun's latest > patch would reintroduce the original race, I'm leaning back toward the > patch Neil sent yesterday. It relies solely on spinlocks, and so doesn't > have the subtle memory-ordering requirements of the others. It has subtle locking changes, though. It now calls the "->lm_notify()" callback with the wait queue spinlock held. is that ok? It's not obvious. Those functions take other spinlocks, and wake up other things. See for example nlmsvc_notify_blocked().. Yes, it was called under the blocked_lock_lock spinlock before too, but now there's an _additional_ spinlock, and it must not call "wake_up(&waiter->fl_wait))" in the callback, for example, because it already holds the lock on that wait queue. Maybe that is never done. I don't know the callbacks. I was really hoping that the simple memory ordering of using that smp_store_release -> smp_load_acquire using fl_blocker would be sufficient. That's a particularly simple and efficient ordering. Oh well. If you want to go that spinlock way, it needs to document why it's safe to do a callback under it. Linus