Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp783985pja; Thu, 19 Mar 2020 10:53:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvvLdEXMEQ0FGu8suRBnSX6+LRThXun16W+vXwELSNPddeQALeCKNTh2jz5IgS/Rb7jkX5J X-Received: by 2002:aca:5596:: with SMTP id j144mr3386156oib.62.1584640433155; Thu, 19 Mar 2020 10:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584640433; cv=none; d=google.com; s=arc-20160816; b=etDjeIkbHXr++ggF0yp7CIGPoA6wVvHKpuOWxOjO/ib3rPV4l5KXx6UAy53uJJf1sC GgiL0t9vHTq3GrwCBRNeacUW0Y9R/faXGl5nNSnOoGm50U8jTMJAb8aCsNNW4rtFKPSC I8mYE/i6FAYacOAeA9DCfAfjoDclXkQ8hvQkn9PmIqFmSo1CS4b3dakk/itgCLYi8NTP a9EnOcNcTyRRbZ9Zeg11Uct5amYt/lKbUZzi0prKFZMqELX46SDHg1NUAq9gDy04e2aw QP4gAMrmia16JPyi80w9Ibv6F72DrzFwWrVbBbha9kOT8BjBwZ9h6AWn0t3pcDLUwTem i7gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=MGCaIYM/BVlE/ObcqcZrL2OdPQqBKyCl/11iaddf3wE=; b=J81LAT+aIMF5ero9vYUa5Xu3wFJHDZT36C4s2+AEBYFXWbXzjipibEH+cc2VPcp3mt 4wrxexld//IECWV9xk/FuRTXcXTf0rm+UlECagW0nXPx+PY+dO9ra3nKKurwsO5Sy02f U6gHzvsOX/1xrO83jlBR2WW2eZjTwKdUTOCnwRiTlbN3dVrdS1TTZZsBBeBh3CYuTpia 6WkyO5wJCiAxLlhDJbVzryxI3VpR6NnVnJIER6ddCJKMUkCQ2vzEU5nDOzGEINXvHxsO PBfIqxzXmlSv9mBMZonScmd3sClZAu9p4SHj3bDiA8RDeoQZIzDSeyXhXqYGGgmAUCvC Uw5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0UvT1D4S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si1637843otr.270.2020.03.19.10.53.38; Thu, 19 Mar 2020 10:53:53 -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=@kernel.org header.s=default header.b=0UvT1D4S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727138AbgCSRwB (ORCPT + 99 others); Thu, 19 Mar 2020 13:52:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:43400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgCSRwB (ORCPT ); Thu, 19 Mar 2020 13:52:01 -0400 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 05B472072D; Thu, 19 Mar 2020 17:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584640320; bh=SHOS3GFFaivbdQvbvmQXUdj/9i/JrMdJcqQ6ZMWKEho=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=0UvT1D4ScmuQ+iPUH1ekz62MC/eDbQ313IF3jXMNP8ltAcOv3zQmRkCQDmZogKOMo U1fOhLXTtnhdqjhTW0e/JrCp5+s3/2zJzrYnpkHyDGK+LXc573BOo0TDhJom9BYcEh mt3rRs9KzVaG0GBlyxxzqcXQYFtC1iU9tb9WSQ8Q= Message-ID: <5d7b448858d5a5c01e97aceb45dcadff24d6fc28.camel@kernel.org> Subject: Re: [locks] 6d390e4b5d: will-it-scale.per_process_ops -96.6% regression From: Jeff Layton To: Linus Torvalds Cc: NeilBrown , yangerkun , kernel test robot , LKML , lkp@lists.01.org, Bruce Fields , Al Viro Date: Thu, 19 Mar 2020 13:51:59 -0400 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-03-16 at 10:26 -0700, Linus Torvalds wrote: > 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 for all the help with this. Yangerkun gave me his Reviewed-by and I sent you the most recent version of the patch yesterday (cc'ing the relevant mailing lists). I left you as author as the original patch was yours. Let me know if you'd prefer I send a pull request instead. Cheers, -- Jeff Layton