Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp165330imm; Fri, 10 Aug 2018 09:14:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyA6ucCohpqJp+hFkZufK59L+zB9wJKWUb6ZF4+l7fcbzdhB9AiR9ip0cDSN2jYwSw6IseO X-Received: by 2002:a63:7007:: with SMTP id l7-v6mr7038122pgc.206.1533917661999; Fri, 10 Aug 2018 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533917661; cv=none; d=google.com; s=arc-20160816; b=u1z+lnt3LLIL/e6BtrIbwsKbaUUI5KVadpyFj3T102RV8wn+P93vHcLV3VlCHv+9Gp jFgQiNM3Dbj1aFidRd3/6bCa0J/IntS3cVWhBfizpH/OkqL9wSiQpB8OTR8wKZMCjDhe dPby7Nvm10ibfxoNAXaenar4TaLiy0K1QLz3ow88BOSoGprv0MJYFs2Y4k/zOa5uMsdx kHcC2AHHwra7Fegd/Z99Mas1W9KZrVFHFvx62DuX3V1oG/Bhn3zP/jrDmS4HqNG3mT97 uuTGuWxhFRAvKiDzAM0UTBvt51j5cVq72xAvmyoDO57cUhlpu/0U6pX7WG0WkhkS5k1p QBrg== 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=lihD0l5At6olPvGgniVeuiWZs2NzMt3N7/nLI5E4GbM=; b=dvFaiKzsAPpGeBsiwrgGc5zU8adD61Z8R+vcv5tKKN8+8Vfd6oHfynDyzZKqSfrbI2 PHEXR0RRmkMmEntZhk0E6GnLwaWCv70JZTNriD/1uNQTsdxw2za/I1nxAAvtL9D0Yvgb XlOHQ5dvO8H4t4pa+cLhGCvLud7xczcXEzqKBq3KXat8DzIzFtPJpa1vF3i02lr6lDqD pI4O/SBDfUmeExX4NKGoZcfW7iADSXIXN2OV6xBdAmdZGd3D+bpJKSl/ibQwjZwQFk1i ZJM6E+sXgwiuAGX29fIqkd3C37hdG9x8APCSoCuItO9Fjdgnjsuy76cUaO1xPz/TeIYe 96MQ== 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 n17-v6si10273488pgh.609.2018.08.10.09.14.07; Fri, 10 Aug 2018 09:14:21 -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 S1728488AbeHJSSG (ORCPT + 99 others); Fri, 10 Aug 2018 14:18:06 -0400 Received: from fieldses.org ([173.255.197.46]:50756 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727545AbeHJSSG (ORCPT ); Fri, 10 Aug 2018 14:18:06 -0400 Received: by fieldses.org (Postfix, from userid 2815) id DC5CFBD4; Fri, 10 Aug 2018 11:47:42 -0400 (EDT) Date: Fri, 10 Aug 2018 11:47:42 -0400 From: "J. Bruce Fields" To: NeilBrown Cc: Jeff Layton , Alexander Viro , Martin Wilck , linux-fsdevel@vger.kernel.org, Frank Filz , linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/5 - V2] locks: avoid thundering-herd wake-ups Message-ID: <20180810154742.GE7906@fieldses.org> References: <153378012255.1220.6754153662007899557.stgit@noble> <20180809173245.GM23873@fieldses.org> <87lg9frxyc.fsf@notabene.neil.brown.name> <20180810002922.GA3915@fieldses.org> <871sb7rnul.fsf@notabene.neil.brown.name> <20180810025251.GO23873@fieldses.org> <87y3derjut.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y3derjut.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 01:17:14PM +1000, NeilBrown wrote: > On Thu, Aug 09 2018, J. Bruce Fields wrote: > > > On Fri, Aug 10, 2018 at 11:50:58AM +1000, NeilBrown wrote: > >> You're good at this game! > > > > Everybody's got to have a hobby, mine is pathological posix locking > > cases.... > > > >> So, because a locker with the same "owner" gets a free pass, you can > >> *never* say that any lock which conflicts with A also conflicts with B, > >> as a lock with the same owner as B will never conflict with B, even > >> though it conflicts with A. > >> > >> I think there is still value in having the tree, but when a waiter is > >> attached under a new blocker, we need to walk the whole tree beneath the > >> waiter and detach/wake anything that is not blocked by the new blocker. > > > > If you're walking the whole tree every time then it might as well be a > > flat list, I think? > > The advantage of a tree is that it keeps over-lapping locks closer > together. > For it to make a difference you would need a load where lots of threads > were locking several different small ranges, and other threads were > locking large ranges that cover all the small ranges. OK, I'm not sure I understand, but I'll give another look at the next version.... > I doubt this is common, but it doesn't seem as strange as other things > I've seen in the wild. > The other advantage, of course, is that I've already written the code, > and I like it. > > Maybe I'll do a simple-list version, then a patch to convert that to the > clever-tree version, and we can then have something concrete to assess. That might help, thanks. --b.