Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1615071yba; Thu, 4 Apr 2019 14:30:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6maSZ2YKqFqQziEv3BNVBUfiUtyZAWiRLmrqGENuCh8MPwylS2fZ1WuvTevDcHMX4AzIS X-Received: by 2002:a62:ee17:: with SMTP id e23mr8366524pfi.80.1554413445448; Thu, 04 Apr 2019 14:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554413445; cv=none; d=google.com; s=arc-20160816; b=V6Wbbvh1FjpyJg1Vkw96yRpcghsdKxSQwzuP1xru5Bg7UX33NAL4lpBhHJYpx0h+Cw FjA1Dpn47A7CHd5mOjGGymKeQHUn5MzilDLyI1CQJ4hUP4E+B5Ry5EzM/7BhfjRRgFSY UDsqrjDCY1U2wUrFpqQW5oIzWaQGu54d08XTqgOlEOVVcQJb/3vgzvQtzeC8r0oZCJkQ mfbkuiMyA5KY+28GqqDXKCXHfpY+JW99HdcqhQFrvkzxSfvK24zrQcQfAr7+zr1KZb8U hnUWuAvqWvTXu7tZm7N7rFCQhFdtMvjJYmXg5LO4bBMFAA2qIbprOogiAno76EFVio2u 0Wog== 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:dkim-signature:dkim-signature; bh=MZAuKYKhVUdXNXP8VDdaXdcH3xxr14eBQKAZ0V3Br2Y=; b=N71qXhfpqnq066aFpcpiT4x/PiM0Ceak86lIyKgbuAfeoKuDh2UwHMnfCVL3RjFeqw gtbkr+xun8Xflg0lXZvwryID/dlI4h1J6thf6Q8+b7U4k9iXoUyDaFQ1untIbp83fE1e SeGbe8E3cHPOkzr61FLL32ceUZTHb5/siXRmNjZbANn+3LGXSvTiLgICQvnsxqzJqYdc d+5/qoAalBiptkOtgnlY0N1paJnj8YrKo2aCvGDH0RNgrEvB3n+KoXIvng6wYgAaX+K7 nmdKPxhUWG4LrX2JHP2qOmAHMlLH98kueNa9znXIGa47YutujuWei9Gfd1bE2obwUQmk ERBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm2 header.b=PdEV3E10; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=m3O8CmWU; 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 h97si17427063plb.302.2019.04.04.14.30.30; Thu, 04 Apr 2019 14:30:45 -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; dkim=pass header.i=@tobin.cc header.s=fm2 header.b=PdEV3E10; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=m3O8CmWU; 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 S1730045AbfDDVSm (ORCPT + 99 others); Thu, 4 Apr 2019 17:18:42 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:44867 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727310AbfDDVSm (ORCPT ); Thu, 4 Apr 2019 17:18:42 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 32F4D22074; Thu, 4 Apr 2019 17:18:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 04 Apr 2019 17:18:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobin.cc; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=MZAuKYKhVUdXNXP8VDdaXdcH3xx r14eBQKAZ0V3Br2Y=; b=PdEV3E10YP6K3/Bkgib8IGcQODXjDSUsxxb2QyRq5xV sz7bTuhNmDxvRcXfdwbnlauiwj8w8sdwWcbO4sLt77PXP8/VK/XTKu/wYVLf/5mC JlfmY32L3yJkpkXC40GR85A9Otq5ufQtIz9IaHpVElJTvwgb1B3V2KE0C+L17uVb b4vTX0gFTGE8Y+kwcQ+kDuFh/LT487ESuTJIDS41V6iedrYDAvyVVKxm52gZQtvS F3HYEfFh5rSvfqjHq8x4OiyCh8UYcAA4K/A5ULMOe9ye6tfAEoflrSBNEh6D2m7j kj/oLAjhLP7053bS3VCiZ0Zj1Z+qGECzm60nd0Rqnrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=MZAuKY KhVUdXNXP8VDdaXdcH3xxr14eBQKAZ0V3Br2Y=; b=m3O8CmWUzxxiAnfloEO0Pq iHKChmfTn5frqDm3x9G2hs1BgP5ODO9a+u4J3KY2d6x+YtxlEu1SA7qd50rPZCVO CkMdziTlOwHjs/bPJR7FcAaRYvv5nwQLxm6yz4CvFIKr4KXgIEmaRQa0Gyke2H1w K/ixQn9VL0cYtfILWP+f6mH07VVnca3I5/alHZ4RJyTC8PtNZa9apDj3mvrA0vnC hNTQhT9JVk6hw7QBHxEw4wddmPPJgnbpQkQVPlLmlI19Ro8K4aj7fffaANW0b/1V g296sTlzIFIbXaNBDztfhjebPGKAQTtKQ8Jpm2Xb2YZLX5l4Q738c7s90jXi1D+A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdehgdduheekucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffk fhggtggujgfofgesthdtredtofervdenucfhrhhomhepfdfvohgsihhnucevrdcujfgrrh guihhnghdfuceomhgvsehtohgsihhnrdgttgeqnecukfhppeduvdegrddugeelrdduudeg rdekieenucfrrghrrghmpehmrghilhhfrhhomhepmhgvsehtohgsihhnrdgttgenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (124-149-114-86.dyn.iinet.net.au [124.149.114.86]) by mail.messagingengine.com (Postfix) with ESMTPA id AB3CA100E5; Thu, 4 Apr 2019 17:18:36 -0400 (EDT) Date: Fri, 5 Apr 2019 08:18:05 +1100 From: "Tobin C. Harding" To: Al Viro Cc: "Tobin C. Harding" , Andrew Morton , Roman Gushchin , Alexander Viro , Christoph Hellwig , Pekka Enberg , David Rientjes , Joonsoo Kim , Christopher Lameter , Matthew Wilcox , Miklos Szeredi , Andreas Dilger , Waiman Long , Tycho Andersen , Theodore Ts'o , Andi Kleen , David Chinner , Nick Piggin , Rik van Riel , Hugh Dickins , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [RFC PATCH v2 14/14] dcache: Implement object migration Message-ID: <20190404211805.GA18488@eros.localdomain> References: <20190403042127.18755-1-tobin@kernel.org> <20190403042127.18755-15-tobin@kernel.org> <20190403170811.GR2217@ZenIV.linux.org.uk> <20190403171920.GS2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190403171920.GS2217@ZenIV.linux.org.uk> X-Mailer: Mutt 1.11.4 (2019-03-13) User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 03, 2019 at 06:19:21PM +0100, Al Viro wrote: > On Wed, Apr 03, 2019 at 06:08:11PM +0100, Al Viro wrote: > > > Oh, *brilliant* > > > > Let's do d_invalidate() on random dentries and hope they go away. > > With convoluted and brittle logics for deciding which ones to > > spare, which is actually wrong. This will pick mountpoints > > and tear them out, to start with. > > > > NAKed-by: Al Viro > > > > And this is a NAK for the entire approach; if it has a positive refcount, > > LEAVE IT ALONE. Period. Don't play this kind of games, they are wrong. > > d_invalidate() is not something that can be done to an arbitrary dentry. > > PS: "try to evict what can be evicted out of this set" can be done, but > you want something like > start with empty list > go through your array of references > grab dentry->d_lock > if dentry->d_lockref.count is not zero > unlock and continue > if dentry->d_flags & DCACHE_SHRINK_LIST > ditto, it's not for us to play with > if (dentry->d_flags & DCACHE_LRU_LIST) > d_lru_del(dentry); > d_shrink_add(dentry, &list); > unlock > > on the collection phase and > if the list is not empty by the end of that loop > shrink_dentry_list(&list); > on the disposal. Implemented as suggested, thanks. RFCv3 to come when we have some stats for you :) thanks, Tobin.