Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp235208ybl; Thu, 12 Dec 2019 17:16:36 -0800 (PST) X-Google-Smtp-Source: APXvYqx8PAkCaIK1XanueqsbJlmHXjSuuDnn1Uu6J5KHP9lIXGeSkqXKTffHEv6+RdFt6R6Ec58H X-Received: by 2002:a9d:2073:: with SMTP id n106mr11437701ota.145.1576199796103; Thu, 12 Dec 2019 17:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576199796; cv=none; d=google.com; s=arc-20160816; b=b6pDo2ikYOHcigYAJ3RZCTvjHOUmAeTOnMVn9Zk5/ut820fkJZwSqjkBVuuci68aTj SgRAsv4PNh1Eytu4V9vWyH0Po0OJSVVBMtQCNMEQPiy331t5Zh7yrpjXGkwb108sGKh+ ogEbZ5z/Hpe4PSYxypZP0U4tIR2MN45XOL05d9XgWtlA/ix11hbqmsjD8bc4wqIv7XAr AHSUM/RWhIZ5tszElQS4y/OUwHqFPzMw/Iko5kyn20hz+eAjBnaxqtrQBhdhAFI8UZ7D BXWZIOs81IgeRQCzHeRqsXvqRUBz4AhhEJCKy501xt6m9atRfjxbjJem78AYanr0o6X1 /9Rg== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ECcenlmllGkokVam6hupLOtFxY8TlFHxp4QHujWbFSM=; b=cZlgo81dyELlFyYMRj95o6AkW7PpEUPp7/hBppg47tAnbxG8fjK/UKIIv+pxUg3Vve HJ7SpOdUSvum6rQN8+p6ZazEkoErNOWLMWdxia+BsqHHvuD1gV9SJwimOms8Qrfwj24R Lb6jpBm0GsGIU4SYUOPmbNF2fojIuSfF8YSXeRLGuvyLCDwSeLpxxEIMkm6XutcsIDXk rCpRI8EJ/6dOPLfdLz4sm4AcuHsTO2IeLziocEHU6NhtUA3FzxJoMpnSXKIiXMm5nyQC yDblLdSSotVEYnheZ1Xg0VarN0pTKEk8YKCJb50nWBgm90RGulOtCVbxNHokvvTVdRaY u2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CIHvI4iA; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si4283361otq.95.2019.12.12.17.16.13; Thu, 12 Dec 2019 17:16:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CIHvI4iA; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731465AbfLMBQM (ORCPT + 99 others); Thu, 12 Dec 2019 20:16:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:41776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbfLMBQL (ORCPT ); Thu, 12 Dec 2019 20:16:11 -0500 Received: from paulmck-ThinkPad-P72.home (unknown [199.201.64.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E864B2173E; Fri, 13 Dec 2019 01:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576199770; bh=41UXekEdF9kavlN11G4wL1lFhr5jX6Gv12aUkd97nZU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=CIHvI4iA5Eab4AxzB1ehbOKRX3V0VZqXs9o2dsLS3Ww31ZEIHy3ZaaTARQTO58q1/ O17lww/L0A4aA8YGeNLuEvIjGBbZGK2GbN6zm0mUTxj6a+r7w6OpHmobyrMj0/SQjg zMEChoKxDLuJKMh3n9Gdo1Sb3arovX5qCJ22OKEE= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 7180835227E8; Thu, 12 Dec 2019 17:16:10 -0800 (PST) Date: Thu, 12 Dec 2019 17:16:10 -0800 From: "Paul E. McKenney" To: Joel Fernandes Cc: madhuparnabhowmik04@gmail.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, linux-nfs@vger.kernel.org, rcu@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] fs: nfs: dir.c: Fix sparse error Message-ID: <20191213011610.GC2889@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191206151640.10966-1-madhuparnabhowmik04@gmail.com> <20191206160238.GE2889@paulmck-ThinkPad-P72> <20191212215534.GE129023@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212215534.GE129023@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Dec 12, 2019 at 04:55:34PM -0500, Joel Fernandes wrote: > On Fri, Dec 06, 2019 at 08:02:38AM -0800, Paul E. McKenney wrote: > > Thanks for fixing these issues and I caught up with all the patches. > > > > > o Create a list that is safe for bidirectional RCU traversal. > > This can use list_head, and would need these functions, > > give or take the exact names: > > On a related topic, I was trying to reason about how one could come up with > bidirectional traversal without ever getting rid of poisoning. > > As you noted in another post, if during traversal, the node is deleted and > poisoned, then the traverser can access a poisoned pointer. If the list is > being traversed in reverse (by following prev), then poisioning could hurt > it. > > Even with the below modifications, poisoning would still hurt it. No? Were > you suggesting to remove poisoning for such bidirectional RCU list? Yes. We removed forward poisoning from list_del_rcu(), and a list_del_rcuprev() or whatever name would need to avoid poisoning both pointers. Thanx, Paul > Sorry if I missed something. > thanks, > > - Joel > > > > list_add_tail_rcuprev(): This is like list_add_tail_rcu(), > > but also has smp_store_release() for ->prev. (As in there is > > also a __list_add_rcuprev() helper that actually contains the > > additional smp_store_release().) > > > > list_del_rcuprev(): This can be exactly __list_del_entry(), > > but with the assignment to ->prev in __list_del() becoming > > WRITE_ONCE(). And it looks like callers to __list_del_entry() > > and __list_del() might need some attention! And these might > > result in additional users of *_rcuprev(). > > > > list_prev_rcu() as in your first patch, but with READ_ONCE(). > > Otherwise DEC Alpha can fail. And more subtle compiler issues > > can appear on other architectures. > > > > Note that list_move_tail() will be OK give or take *_ONCE(). > > It might be better to define a list_move_tail_rcuprev(), given > > the large number of users of list_move_tail() -- some of these > > users might not like even the possibility of added overhead due > > to volatile accesses. ;-) > > > > Or am I missing something subtle here? > > > > Thanx, Paul