Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2672693imm; Thu, 9 Aug 2018 18:06:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyH24bSxej3Kfj7ZUJdCkNoSbdWu0jXBF2gCofEJcWnhqkblCZnCs/cc/uGDWTmqfa92ot9 X-Received: by 2002:a17:902:a24:: with SMTP id 33-v6mr4044855plo.88.1533863185246; Thu, 09 Aug 2018 18:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533863185; cv=none; d=google.com; s=arc-20160816; b=QZiFqMlthBaU+KzSmIlw7OBLeXajvTxAQAiYDGPXv6CEQ73ebqJkaJoDtAisKA4xJ1 iUkiQTf27YoacTy5rFwVdNNrd5ejwf7OUN7zz2ipTJZnZf4UzbWrL32de3k1F2fOf5Yy 3MZSFrEE2YBoo04MQ/DLZizGgjU07GUZ0fHzds4vrK5kzx089XuktrA4IYaKW9A0zcLv xuJta7kRvfb+dol+jckiqQst9myJPlBAInaU48CXwKCvod56TjdrrT39Dycyrw1g+C2i oqKFKqYmGdAlxnn/ERDHkaS6lAKShZOQLoK8HmWsSIgv82ap3prXMlEoibbbj/+a4+vl iARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/v1ZAQLvy4DZnQ/gdgeqq8DZ1vL+NJHIvXYEqiVgHhE=; b=Z0DDC268zDXIAxLV273joWCQOcV09BQvFgU/1RFH+6WnSJ/eZYEA47o1k2du+kI4l8 m50MzQx9p4x++Fm2WkEjTTTN2hasytTrGxRIwZQzRo29AJpVoXwW33ElHR1XTodUP2+8 zBuwXF5oyPfEglV2+LN3WDaa50VApihRHhiUC7Jx7/dtLrEhlcMicLuI30pXSDaFOg/P ZlVhCxg6oAZ0fUm/ummqnFt48XGetBkmxe4ATsfLvzzF1QPRDN2cDoljSUdYkq2rdd9m fMaOjKttuzF6K6YLT6v7555ifWRKNx3knkvkZRa26bRIxWxuFpQMgAPYq3iLXHDYMfwq n/6g== ARC-Authentication-Results: i=1; mx.google.com; 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 y10-v6si8744480pgf.312.2018.08.09.18.06.10; Thu, 09 Aug 2018 18:06:25 -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; 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 S1727206AbeHJDcq (ORCPT + 99 others); Thu, 9 Aug 2018 23:32:46 -0400 Received: from fieldses.org ([173.255.197.46]:49516 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbeHJDcq (ORCPT ); Thu, 9 Aug 2018 23:32:46 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 0945F1E3D; Thu, 9 Aug 2018 21:05:19 -0400 (EDT) Date: Thu, 9 Aug 2018 21:05:19 -0400 From: "J. Bruce Fields" To: NeilBrown Cc: Jeff Layton , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Wilck Subject: Re: [PATCH 0/4] locks: avoid thundering-herd wake-ups Message-ID: <20180810010519.GD3915@fieldses.org> References: <153369219467.12605.13472423449508444601.stgit@noble> <20180808195445.GD23873@fieldses.org> <20180808200912.GE23873@fieldses.org> <20180808212832.GF23873@fieldses.org> <04ffa27c29d2bff8bd9cb9b6d4ea6b6fd3969b6c.camel@kernel.org> <20180809130001.GG23873@fieldses.org> <877ekzrt60.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877ekzrt60.fsf@notabene.neil.brown.name> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 10, 2018 at 09:56:07AM +1000, NeilBrown wrote: > On Thu, Aug 09 2018, J. Bruce Fields wrote: > > If we only cared about the former, and only in simple cases, we could > > walk the entire list and skip waking up only the locks that conflict > > with the first one we wake. We wouldn't need the tree. > > Yes, we could do that. It would probably make the code simpler. > It would mean doing the conflicts() tests when performing wake-up rather > than prior to going to sleep. In general it would mean doing the tests > more often, as the tree effectively records the results of the previous > time conflicts() was run. > You might get a quadratic effect though ... wouldn't you want to > skip anything that conflicts with anything that has been woken? I was thinking it'd be simplest just to check for conflict with the first thing that you decide to wake. That might be all that's necessary for typical cases. If you wanted to keep a running list of the locks you've chosen to wake so far and check each one against that list, I guess you could. > If the tree-management code turns out to be too complex, it would > certainly be an option. I think the tree approach should result in less > total CPU usage.. Have we ever looked into the CPU usage of deadlock detection? Might experiment with turning that off. But I may be biased by my white-hot hatred of it. --b.