Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1958124imm; Thu, 12 Jul 2018 10:34:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflyxZYM2VBx1TJRjqmjxSi9EbIoHmT6mTjlt+5ldnwExYBLQp19+/CgdqFhEZ5SQMWF4mF X-Received: by 2002:a17:902:e201:: with SMTP id ce1-v6mr2147667plb.136.1531416894361; Thu, 12 Jul 2018 10:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531416894; cv=none; d=google.com; s=arc-20160816; b=WGUTk5VfgFz5TUr1r1VGiv+HX4zuKLlAdS+aTQkN/OFyhocOtCes0Vb0EgJNVr19tA 9rkEx1DjDDUK5dndwnQFBnVh8D+OV+6x48JCr9BO74FkN6aZw8Gbl9dQrH7ZiVSlg95x fH+1fGnMAiAJJM31dPf8s3TsIl6XpSrYHnfpd3ehYvOvdfx2YlCN54pHAupVD069AtM9 zOuRFhZnffG0Gkt7BqSlxsW1pAIOEVpq8c9M5t7THmlHCWg+AJ93xVKFIVLkgK6HYcf9 MkfYP6vMDVA7PoTN8dbmX18G+cx5n5hFzwW4Y9XJX9VeeQ1tB/USnDDh1c5aMMksmK9o z+nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=N5NtZUefxDc7iEsO26a5r75jlE5xh0bHIqC99+DcJrA=; b=wYesTa7gG0nOKWXa1s8L443jGycxAXD6EkoMpoU1e6Mm4ek7nqoKj1fvjZCRVcLW1T Qe/7avRBeRJqg0UsxnHDsv2h9J3Jbh9M7i/HFZTahec7p0Posz0X+NRZZzKwTTFpc0HT XmvWOHqKNwfvlumDHfe4jh3su4v1w0XojIgKw4jxcZEleJOp9w3x/z888+SQOV9/j9i0 onXm+A1G4kf7Yem45Bwf6YaPI+MussAsZNRWN9vqiECAgUufQDRFBP8lIXriBxZ2gToK /lgKOINgMoVuRONh/VA0PEthGksT81p+wHg5knKpove6YSKvfBTowMSPgPw90N5Bst97 MS5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=pMsd2c6A; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si24254737pfd.86.2018.07.12.10.34.39; Thu, 12 Jul 2018 10:34:54 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=pMsd2c6A; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbeGLRo2 (ORCPT + 99 others); Thu, 12 Jul 2018 13:44:28 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:38592 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbeGLRo2 (ORCPT ); Thu, 12 Jul 2018 13:44:28 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id B57898EE3D1; Thu, 12 Jul 2018 10:33:55 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FWM_1h14zIs3; Thu, 12 Jul 2018 10:33:55 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.68.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id CAA278EE02B; Thu, 12 Jul 2018 10:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1531416835; bh=P+0Y3CmrPjaP0qgRVVH0vxI/F3BD8twcnxEYeh9Mm9Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=pMsd2c6AJOGcK0wgTLAxS/qXvVqj8qmcqCvMjs3YuCcnlLgmWgd9WqaaZhowQOQJ9 WylxiiGm+itvtc4kO2kDKs3gR+8ejveo6I2s2qjgRHNi7uMKSBp5IlTszpC5Ll2bGp c/w0aIZP9vZlym+Tfq46zFaUzPVa5Z96+edGSVJY= Message-ID: <1531416833.18255.10.camel@HansenPartnership.com> Subject: Re: [PATCH v6 0/7] fs/dcache: Track & limit # of negative dentries From: James Bottomley To: Waiman Long , Michal Hocko Cc: Alexander Viro , Jonathan Corbet , "Luis R. Rodriguez" , Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, Linus Torvalds , Jan Kara , "Paul E. McKenney" , Andrew Morton , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , "Wangkai (Kevin C)" Date: Thu, 12 Jul 2018 10:33:53 -0700 In-Reply-To: <30ac8e9b-a48c-9c37-5a96-731ad214262b@redhat.com> References: <1530905572-817-1-git-send-email-longman@redhat.com> <20180709081920.GD22049@dhcp22.suse.cz> <62275711-e01d-7dbe-06f1-bf094b618195@redhat.com> <20180710142740.GQ14284@dhcp22.suse.cz> <20180711102139.GG20050@dhcp22.suse.cz> <9f24c043-1fca-ee86-d609-873a7a8f7a64@redhat.com> <1531330947.3260.13.camel@HansenPartnership.com> <18c5cbfe-403b-bb2b-1d11-19d324ec6234@redhat.com> <1531336913.3260.18.camel@HansenPartnership.com> <4d49a270-23c9-529f-f544-65508b6b53cc@redhat.com> <1531411494.18255.6.camel@HansenPartnership.com> <30ac8e9b-a48c-9c37-5a96-731ad214262b@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-07-12 at 12:26 -0400, Waiman Long wrote: > On 07/12/2018 12:04 PM, James Bottomley wrote: > > On Thu, 2018-07-12 at 11:54 -0400, Waiman Long wrote: > > > > > > It is not that dentry cache is harder to get rid of than the > > > other memory. It is that the ability of generate unlimited number > > > of negative dentries that will displace other useful memory from > > > the system. What the patch is trying to do is to have a warning > > > or notification system in place to spot unusual activities in > > > regard to the number of negative dentries in the system. The > > > system administrators can then decide on what to do next. > > > > But every cache has this property: I can cause the same effect by > > doing a streaming read on a multi gigabyte file: the page cache > > will fill with the clean pages belonging to the file until I run > > out of memory and it has to start evicting older cache > > entries.  Once we hit the steady state of minimal free memory, the > > mm subsytem tries to balance the cache requests (like my streaming > > read) against the existing pool of cached objects. > > > > The question I'm trying to get an answer to is why does the dentry > > cache need special limits when the mm handling of the page cache > > (and other mm caches) just works? > > > > James > > > > I/O activities can be easily tracked. Tracked? What do you mean tracked? you mean we can control the page cache through userfaultfd or something without resorting to cgroup limits or something different? I mean all caches are "tracked" because otherwise we wouldn't know whether we have to retrieve/generate the object or pull it from the cache. If it's just about cache state, what's wrong with /proc/sys/fs/dentry-state? > Generation of negative dentries, however, is more insidious. So the > ability to track and be notified when too many negative dentries are > created can be a useful tool for the system administrators. Besides, > there are paranoid users out there who want to have control of as > much as system parameters as possible. To what end? what problem are these administrators trying to solve? You keep coming back to the circular argument that the problem they're trying to solve is limiting negative dentries, but I want to know what issue they see in their systems that causes them to ask for this knob. James