Received: by 10.223.176.46 with SMTP id f43csp1247978wra; Wed, 24 Jan 2018 13:10:31 -0800 (PST) X-Google-Smtp-Source: AH8x2271wCWoXgB/EAPn0OMlc5HD22YWf6voigc9FpZvwWCscx2kZcaofizKssnyX5j6JEeVXmQs X-Received: by 2002:a17:902:10b:: with SMTP id 11-v6mr9536204plb.336.1516828231476; Wed, 24 Jan 2018 13:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516828231; cv=none; d=google.com; s=arc-20160816; b=IneberKG8CRnv6Y1KHHTx4nMSfBft/Ha6PAg8dUJ+ZGJBxJyo2heBn4+9dobghze5c /MF+Tl7bmE90xqvKPoWZx/e+9G7CzwZP/ovtogh6b96aCbA66h8N/H4+lq9PyJMgL02J ViSnt3MtV1lMWFDOsIle0EiD+O1Z+8wdjD9a4UIqhqk5NbawQtNUXErPRhc4L1JKEOdK 42TYdtb3ol6K2sDrf5oSqQUqcHOATgyGymSC2XhPxUBwBb7S2zSF0b9IZsxjBE7t6hq3 DfAIpiEvMHKXy7v1UK6TmG2gdgWnnGo9n1MIJ5MNeY7Zg0vaUrJT9EZogEP5z1UsJebJ Wqlg== 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=QRntpdznqpm0D7AlJfhDj+rwDB/cWP7qfuhDIqv3VGI=; b=jbf/u7fCAqnf6YZ9jTzIyQXZI1VDc8SefDrLrkn83qsywsVtzwQdF63bpxiGXNGVUE 4SJB8RK6PJcFj4093AVfq6DlX1wXKG9GnwBMsyfk8TDtAV95r/mgkFKCmj65keGijlA6 xI49OGNVJfuvGLPgWknsw+CmeVidneC/aRDJfHEYZ4bI4jx2Q/AA9Aa3avG00gdcURfG lbO6B/Uo4NTCbi7v6+1znOznXyrG1BDZJOM1RjBJctZK+GCIuQWdLijYHpMQ8sohnJxL 23DeDkY2a3ybSRkrAjMysKRFF2TH3nh/8BotmaJPiH03nmGFcweo6VowIk5MKFHixPLi M9dg== 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 3si3447653pfi.416.2018.01.24.13.10.16; Wed, 24 Jan 2018 13:10:31 -0800 (PST) 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 S932505AbeAXVJw (ORCPT + 99 others); Wed, 24 Jan 2018 16:09:52 -0500 Received: from fieldses.org ([173.255.197.46]:51836 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeAXVJv (ORCPT ); Wed, 24 Jan 2018 16:09:51 -0500 Received: by fieldses.org (Postfix, from userid 2815) id B86DCAAD; Wed, 24 Jan 2018 16:09:50 -0500 (EST) Date: Wed, 24 Jan 2018 16:09:50 -0500 From: "J. Bruce Fields" To: Trond Myklebust Cc: "Reshetova, Elena" , "linux-nfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jlayton@kernel.org" , "anna.schumaker@netapp.com" , "peterz@infradead.org" , "keescook@chromium.org" Subject: Re: [PATCH 1/4] lockd: convert nlm_host.h_count from atomic_t to refcount_t Message-ID: <20180124210950.GA12840@fieldses.org> References: <1511954146-11793-1-git-send-email-elena.reshetova@intel.com> <1511954146-11793-2-git-send-email-elena.reshetova@intel.com> <20171221202350.GE31467@fieldses.org> <2236FBA76BA1254E88B949DDB74E612B802CFB57@IRSMSX102.ger.corp.intel.com> <20171222142553.GA9630@fieldses.org> <20171222154250.GB9630@fieldses.org> <2236FBA76BA1254E88B949DDB74E612B802D08DA@IRSMSX102.ger.corp.intel.com> <20180123220950.GA5632@fieldses.org> <1516754851.18068.3.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516754851.18068.3.camel@gmail.com> 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 Tue, Jan 23, 2018 at 07:47:31PM -0500, Trond Myklebust wrote: > Sorry I forgot about the issues with the server garbage collector, and > I applied these patches to my linux-next a couple of weeks ago. Whoops, OK, so who's taking those patches anyway? > What say we fix the issue with something like the following? ... > @@ -662,8 +664,7 @@ nlm_gc_hosts(struct net *net) > for_each_host_safe(host, next, chain, nlm_server_hosts) { > if (net && host->net != net) > continue; > - if (refcount_read(&host->h_count) || host->h_inuse > - || time_before(jiffies, host->h_expires)) { > + if (host->h_inuse || time_before(jiffies, host->h_expires)) { Can you really just drop the h_count check? Oh, I see: > @@ -671,7 +672,8 @@ nlm_gc_hosts(struct net *net) > host->net->ns.inum); > continue; > } > - nlm_destroy_host_locked(host); > + if (refcount_dec_if_one(&host->h_count)) > + nlm_destroy_host_locked(host); So this is check that replaces it. Makes sense to me, thanks. ACK to the patch. --b. > } > > if (net) { > -- > 2.14.3 > > -- > Trond Myklebust > Linux NFS client maintainer, PrimaryData > trond.myklebust@primarydata.com