Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp428279yba; Wed, 3 Apr 2019 11:27:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH7r/By87iOmGsuAJ3THMnlAucE58InOuQnR/h5Fc0iQ2L/Mp/EGoQm5caXrfPl1jBiCZ5 X-Received: by 2002:a17:902:ba88:: with SMTP id k8mr1529293pls.268.1554316048032; Wed, 03 Apr 2019 11:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554316048; cv=none; d=google.com; s=arc-20160816; b=xvmklc2pE64mpYQzEPnp/LmbzgAyAndAHiUaPDk79eFHHFUgNt52Q2t3eBF28ycDGu HcfGMzl1+VzytNiT4/jUs9cC4M0CiWMXfI92L9Udj3nJ8GtsvDNFzu4gOAJtwJK+7Wbq dFkO8sxEkYI2ON1I+mG4hHwBHeq+1cYyA+7h09QJ3S6rTSnvIq70xT0UbpFqvrkd+tWn HUS5PvbtBvGu/xBcSmFZ69trm4yAGARG560eAqLpcqU/qhpAfIApHEjRUSXp5+uN28i9 3gn5BMa0QBuSYiJTU5LmYDNrjU5eXhXMM9tw273SirIFjJV1egjX1h7hMZLj/iUM2PEP lSKQ== 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; bh=QsEsqZIJDEiA5mPa+vu0/y83h0JGwyblEvsQ1cxdW9k=; b=SLx/AHkbLUNdMHLumOM2QYTxD03pkLDAz+nOtzvwCer/tnu6hr0pY6v8gShMIL3YuK +OyjoZr7FsxMDO5QqktbSbS1DHE2ePqfe/971wyxDtJcbgZg1R3Jd6Kd0lYWTEzDFBp5 TmYyKV2Wh8VNRBfPWo2AOiI3LHPKE5SkkksjU4sZiaOp0n29wHFiDmkczV1BWJ5WiuFk NsZ9A6pSUwAd7AtZC1+ocKYs2cI2hMHTut96gNu6Wgp/nsWmpB/71fLZ393A74hyv5+a WZOnkd7jfGNGJlekW4l2N3gSXuuq0la7xQswpz48qWWVzNgu6BdCVKZkAhn7dekqVYMO K4hQ== 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 j1si14299516pfe.189.2019.04.03.11.27.12; Wed, 03 Apr 2019 11:27:28 -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 S1726337AbfDCSZT (ORCPT + 99 others); Wed, 3 Apr 2019 14:25:19 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:34884 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbfDCSZT (ORCPT ); Wed, 3 Apr 2019 14:25:19 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hBkZC-0005dH-Oh; Wed, 03 Apr 2019 18:24:54 +0000 Date: Wed, 3 Apr 2019 19:24:54 +0100 From: Al Viro To: Christopher Lameter Cc: "Tobin C. Harding" , Andrew Morton , Roman Gushchin , Alexander Viro , Christoph Hellwig , Pekka Enberg , David Rientjes , Joonsoo Kim , 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: <20190403182454.GU2217@ZenIV.linux.org.uk> References: <20190403042127.18755-1-tobin@kernel.org> <20190403042127.18755-15-tobin@kernel.org> <20190403170811.GR2217@ZenIV.linux.org.uk> <01000169e458534a-3c6a5d6f-3054-4c64-b5f9-7f46c811eeac-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01000169e458534a-3c6a5d6f-3054-4c64-b5f9-7f46c811eeac-000000@email.amazonses.com> User-Agent: Mutt/1.10.1 (2018-07-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 05:56:27PM +0000, Christopher Lameter wrote: > On Wed, 3 Apr 2019, Al Viro wrote: > > > 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. > > Well could you help us figure out how to do it the right way? We (the MM > guys) are having a hard time not being familiar with the filesystem stuff. > > This is an RFC and we want to know how to do this right. If by "how to do it right" you mean "expedit kicking out something with non-zero refcount" - there's no way to do that. Nothing even remotely sane. If you mean "kick out everything in this page with zero refcount" - that can be done (see further in the thread). Look, dentries and inodes are really, really not relocatable. If they can be evicted by memory pressure - sure, we can do that for a given set (e.g. "everything in that page"). But that's it - if memory pressure would _not_ get rid of that one, there's nothing to be done. Again, all VM can do is to simulate shrinker hitting hard on given bunch (rather than buggering the entire cache). If filesystem (or something in VFS) says "it's busy", it bloody well _is_ busy and won't be going away until it ceases to be such.