Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2829118ybh; Mon, 16 Mar 2020 10:28:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vudz4nqTjPoZptG76P5PXiXVR3T0er6ysD1Gs4yCF7vV2YuKTgoLU5vW6/nfu2SYNyuCVZO X-Received: by 2002:a9d:5ad:: with SMTP id 42mr265337otd.231.1584379692954; Mon, 16 Mar 2020 10:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584379692; cv=none; d=google.com; s=arc-20160816; b=KcE1s2uJ/jWpqHvaokysLi4CwQTSRrB7KDOXpILO8ocqeiW74Yf2Q18zDzUcppIw5r x3VqHHntku9Skk/+WfoErsmioFm9pjdizbp+NO4bkVU3HaXIYOO6wXeWvzKPIjMVhv5g tmCtgGsqnkAVn7h2nmYaUIBIn37GpQNC4qrXwHRfUbUNWsF9aT4R5f9TGu/4kCoTlw4u BI5U4XCd1wNPou5nZFkifmW3iWIhinwwvN8Wg/JqiSy2AiMttGiXMNTyawswf786CYWK DeDHQbOhh3imOvHoeJctAjokG+JDGB0g5o98FRN+o90LXt/rAbnSgSx2olxfOoGvWhzp 7/5g== 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=DMMGwqm11i++eOrcoQ51CLKjc9B8b60ZGiRJoVHy98E=; b=oBSSw1dNpNCsGZRi0HwGGbaZ4hGRMIhXef8s7EkpUx5xjfLWAPlk74oYWPKDW2oFfd 24UY3NZsGyg22st5HeYytD3yR2cI7PL4fcjup/g1wQvzhk3YXrKVvSaINGI3IeY1NI/6 adT18DK8D1uYuPc7PPJp5/ElDJorPMySpKKJB0DSOGokaA5X3D6ZKBseJzwh2tF9OmNp Xb0lYuZyxfkZCHjzt6x0DiUDPPEsiD5q+2tG8tXKtGBu+LOfo9/Wd5DPsMGf9PYDfNQW FjIKbOWB94fqQiDFaWnWl/9d19+zTn3ec8ljZCcPlO5XBUnd8wDMKhK1jstjAIbHaAdp AO8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="MJ9Q/HYw"; 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 f3si260522oia.264.2020.03.16.10.27.59; Mon, 16 Mar 2020 10:28:12 -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="MJ9Q/HYw"; 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 S1731717AbgCPR1V (ORCPT + 99 others); Mon, 16 Mar 2020 13:27:21 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41710 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731136AbgCPR1V (ORCPT ); Mon, 16 Mar 2020 13:27:21 -0400 Received: by mail-lj1-f196.google.com with SMTP id o10so19599879ljc.8 for ; Mon, 16 Mar 2020 10:27:18 -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=DMMGwqm11i++eOrcoQ51CLKjc9B8b60ZGiRJoVHy98E=; b=MJ9Q/HYw+ovlaE/zZJRh9JpRhaw6V6SXu5XO1Fqqu6ZGU01dZu/JLzEnPevXgP4zYB fn3GePVRLo5oklQpIogzLt9PPFM4dRyaGtnemw6mxcBTBnDjLUI1HuYPUqH98zL/Dqq5 uadBDvnI/AUR6Dw/rt2wU0UlVVYE8g2lIyAVg= 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=DMMGwqm11i++eOrcoQ51CLKjc9B8b60ZGiRJoVHy98E=; b=MrCOA6pjyb2FLX9zqkQBwqzMgvS9pz2/8tJKFPBJpxzCDfDVuBXdxVzwPwcgsb/e1b y0bh3kJfv1q4q+8F0Ig2+bX/pQ72kZ1pMGYbtpufHMpTELP+tt5T61B7bgGZue3si/ii noyYmsIoi4Af9IqwfUqjDqFrWx8ojuIrvoBxyHqGLtAwXHh0ApwaSbdiNW4rKffAxvDl yCTlVJtoXdZa0gFKqPnKY4HTyiRScK9OYW8llBBpWK64wNiaM/PJZLjVJKQ3zAFQaTjh SohhnY2tVDZV5Z7kdIppgfzbwH1VJlo07xaIjV9/IPHkw+2Biqd4JYN27muBCzgeN1uK MuvQ== X-Gm-Message-State: ANhLgQ29q4+3Q6E0hlKymnyeqZFJsvTaNIigbNAqPHARvuUuqR0OjJQl diJjsCnLrmkTAIWiOrIqYBEl5Xqc5d8= X-Received: by 2002:a2e:868b:: with SMTP id l11mr212434lji.69.1584379637779; Mon, 16 Mar 2020 10:27:17 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id m16sm355035lfb.59.2020.03.16.10.27.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Mar 2020 10:27:16 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id j15so14815691lfk.6 for ; Mon, 16 Mar 2020 10:27:16 -0700 (PDT) X-Received: by 2002:ac2:5508:: with SMTP id j8mr273495lfk.31.1584379635940; Mon, 16 Mar 2020 10:27:15 -0700 (PDT) MIME-Version: 1.0 References: <20200308140314.GQ5972@shao2-debian> <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> <87o8t2tc9s.fsf@notabene.neil.brown.name> <877dznu0pk.fsf@notabene.neil.brown.name> <87pndcsxc6.fsf@notabene.neil.brown.name> In-Reply-To: From: Linus Torvalds Date: Mon, 16 Mar 2020 10:26:59 -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 Mon, Mar 16, 2020 at 4:07 AM Jeff Layton wrote: > > > + /* > + * If fl_blocker is NULL, it won't be set again as this thread "owns" > + * the lock and is the only one that might try to claim the lock. > + * Because fl_blocker is explicitly set last during a delete, it's > + * safe to locklessly test to see if it's NULL. If it is, then we know > + * that no new locks can be inserted into its fl_blocked_requests list, > + * and we can therefore avoid doing anything further as long as that > + * list is empty. > + */ > + if (!smp_load_acquire(&waiter->fl_blocker) && > + list_empty(&waiter->fl_blocked_requests)) > + return status; Ack. This looks sane to me now. yangerkun - how did you find the original problem? Would you mind using whatever stress test that caused commit 6d390e4b5d48 ("locks: fix a potential use-after-free problem when wakeup a waiter") with this patch? And if you did it analytically, you're a champ and should look at this patch too! Thanks, Linus