Received: by 10.213.65.68 with SMTP id h4csp1470865imn; Thu, 29 Mar 2018 05:26:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48jPQKMRXTmNFIoruu0aPks4ZcHn0xb6922ovkjQdJHBdozuwDtk/Zan+GRPQY3teawEmPz X-Received: by 2002:a17:902:830a:: with SMTP id bd10-v6mr7953928plb.322.1522326365280; Thu, 29 Mar 2018 05:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522326365; cv=none; d=google.com; s=arc-20160816; b=en59OSf+5aiOcHUnK4CJ5phO41M9qO4WMqufCDgWxcPnn8wtF/0NG3JaeREmiCnvy1 UiQcB+xeTByS9jrJzpyD1bKB1eqmoPsyi79/0FmYcemb7ymzaElMSYCvJ2nTBMnYCXT4 uorKGtLLSyLyHl70SiozSq0j9lzK1Q6gznOTBpWSKeUsNoI7+qmVOnEstLThi5SECb1j pSDa1e/50onSXR6J/zMVrPpsX9Mup0UN7TeYgUDjq8P94eNoVMn6aVuGa198J6mPW8ra WbK3+T36Pa7Kq7vigyuMQwVt556Qwph/loiNou5zT4ADMIf8Mh7lbaI36FFkjTl96HNF dPeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=sAhCkEiNKevDdEMr2Wr+d1tVBBNcrbpEJL8qbanbVNo=; b=KwW8yd5HkQ3zA14pEaQzCkJsQYTvH3qBcqC73BZdZUvDJCoRaJXfUnVB62gHMpid1L bLcXc7tkQw13pKeI76rL9Ac9cwrLQ833/OQJ+YCvcD5N/PFmBh2yKWS+fVIOYRNw9LZg 9AenmHotr79/cknmysZbXgWoC07fr5hMKt3RaGYV2zd5Pg5WPtFcI5UIPp8R1iWCQmbP z8SSK7zGPbH8A2+f3I+3k4hoayf3HHsJ54R+EH2rhY/w4fb1KMLI0wH7XKlAzA2HeIzH 77wNeY2hrh87dWSOe6EFjs4el9ZKt5v69p65nd0/VkwnCEm41p9xRFuKj2xuCKvUSzVl MXxA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k128si3995024pgc.609.2018.03.29.05.25.50; Thu, 29 Mar 2018 05:26:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752874AbeC2MYO (ORCPT + 99 others); Thu, 29 Mar 2018 08:24:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53736 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752256AbeC2MYN (ORCPT ); Thu, 29 Mar 2018 08:24:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B68C84023141; Thu, 29 Mar 2018 12:24:12 +0000 (UTC) Received: from 117.195.187.81.in-addr.arpa (unknown [10.33.36.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7AE87C36; Thu, 29 Mar 2018 12:24:08 +0000 (UTC) Subject: Re: [Cluster-devel] [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek To: Andreas Gruenbacher , cluster-devel@redhat.com Cc: Herbert Xu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, NeilBrown , Thomas Graf , Tom Herbert References: <20180329120612.6104-1-agruenba@redhat.com> From: Steven Whitehouse Message-ID: Date: Thu, 29 Mar 2018 13:24:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180329120612.6104-1-agruenba@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 29 Mar 2018 12:24:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 29 Mar 2018 12:24:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'swhiteho@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Can we solve the problem another way, by not taking refs on the glocks when we are iterating over them for the debugfs files? I assume that is the main issue here. We didn't used to take refs since the rcu locking was enough during the walk itself. We used to only keep track of the hash bucket and offset within the bucket when we dropped the rcu lock between calls to the iterator. I may have lost track of why that approach did not work? Steve. On 29/03/18 13:06, Andreas Gruenbacher wrote: > Here's a second version of the patch (now a patch set) to eliminate > rhashtable_walk_peek in gfs2. > > The first patch introduces lockref_put_not_zero, the inverse of > lockref_get_not_zero. > > The second patch eliminates rhashtable_walk_peek in gfs2. In > gfs2_glock_iter_next, the new lockref function from patch one is used to > drop a lockref count as long as the count doesn't drop to zero. This is > almost always the case; if there is a risk of dropping the last > reference, we must defer that to a work queue because dropping the last > reference may sleep. > > Thanks, > Andreas > > Andreas Gruenbacher (2): > lockref: Add lockref_put_not_zero > gfs2: Stop using rhashtable_walk_peek > > fs/gfs2/glock.c | 47 ++++++++++++++++++++++++++++------------------- > include/linux/lockref.h | 1 + > lib/lockref.c | 28 ++++++++++++++++++++++++++++ > 3 files changed, 57 insertions(+), 19 deletions(-) >