Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2306876imm; Thu, 9 Aug 2018 10:33:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzZa8Ltw0ot0R4aEJEE4BIrVPa7zJ9oIaXAJnyphr3GBSsExKPoemNYUyplvcz2pEnfkZwr X-Received: by 2002:a17:902:8f8c:: with SMTP id z12-v6mr2868308plo.4.1533836037108; Thu, 09 Aug 2018 10:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533836037; cv=none; d=google.com; s=arc-20160816; b=zdnBwZDzf/Wofzeql3/Cpxph5AGBmGsAjMVC4Qh9Xmdo3lpfoi3YQ6ZAwN67fyKWmZ Cg5yhtxZvz0n4l9I4V4ntOM/tM6dOVngJHBA2vJx415jqKqxedHWfBHuD1q/j66GiEk/ 3cEB81p/c1pGmK81haKhAlljxqX6PvB7EqtAJah4zbgL648diOSZTr/2HmAljxTDIK3S TxhmxTxzLXy7aW8Ny8BIHUaozCvxkTUt52xv1JqDUET32z4FTh2ITpdzVJ0oUt8tXSxo Qm0LkP+EL5t++uiDAfbjJx9bVrA47A9P1ASGvdev58r8IiyqKoOGuJzzOQiW+TnTqOoh f7BQ== 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=t7Peslm/c9FnMp16L83iFld/F2LQHUPT2B2XKzXhfG0=; b=DwqtNNSM9HTHsFJ/rfNxSDlNDQfs9XnyxnX3IvT9hgn6VJxhZPZ7IB08D6PwTEAJmq hQL9xGPwMO99x+J2tD6X/sposfm2BqLa9gjh0pQpuTzXg6NFAgYpDoaZCR/BTBX+noZD 3jUQMIyNt/4gcta5/JEabMBRwxXOYdNGMFCcclraFOCC1la+Jne8rx7BMeTmWAg+HXz2 ii8KGILMMYehC34YoAtTE19IPfuiT9oeOLbFnj0EUnJi6+dbN78+Dd8iC097Zh+arIvt M1pax6+RV308ovXqYGQ8pLwPgOT/+NxRUccym+yLtf9FmZyj2ZfcUUSJZ9nfIovIqLEh rclA== 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 s36-v6si6019046pld.8.2018.08.09.10.33.42; Thu, 09 Aug 2018 10:33:57 -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 S1732653AbeHIT6i (ORCPT + 99 others); Thu, 9 Aug 2018 15:58:38 -0400 Received: from fieldses.org ([173.255.197.46]:48832 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730839AbeHIT6h (ORCPT ); Thu, 9 Aug 2018 15:58:37 -0400 Received: by fieldses.org (Postfix, from userid 2815) id CD5C81E3A; Thu, 9 Aug 2018 13:32:45 -0400 (EDT) Date: Thu, 9 Aug 2018 13:32:45 -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: <20180809173245.GM23873@fieldses.org> References: <153378012255.1220.6754153662007899557.stgit@noble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153378012255.1220.6754153662007899557.stgit@noble> 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 I think there's also a problem with multiple tasks sharing the same lock owner. So, all locks are exclusive locks for the same range. We have four tasks. Tasks 1 and 4 share the same owner, the others' owners are distinct. - Task 1 gets a lock. - Task 2 gets a conflicting lock. - Task 3 gets another conflicting lock. So now we the tree is 3->2->1. - Task 1's lock is released. - Before task 2 is scheduled, task 4 acquires a new lock. - Task 2 waits on task 4's lock, we now have 3->2->4. Task 3 shouldn't be waiting--the lock it's requesting has the same owner as the lock task 4 holds--but we fail to wake up task 3. --b.