Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp925977imm; Fri, 13 Jul 2018 08:34:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfo0dyVHbqbFb/7/wreadhp41dy2Evc0rCh3eMDKNsTh1Mnd9J98kBP2up/jf0VzXvs2Jds X-Received: by 2002:a17:902:9a08:: with SMTP id v8-v6mr6988011plp.148.1531496040031; Fri, 13 Jul 2018 08:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531496040; cv=none; d=google.com; s=arc-20160816; b=B+yb/7PLb8a7Sw6emKudMBI7DI6kJPHb1VjVjcxmkS/Zbe4rBvbXcJXn1r7ffGJzd0 U9vVoAW8YoBt4jdKdM0Il6e7JZnJ4YKuzB2Sd3UO0ex1IhR+VKI9WyPOOpuPAOupgJDJ QMHxK8JDtzhNB/Fpaj/yKhSHhAKCbeQNwoulRbaWOPRNqchMqCnKT17X1UfeMrtje8v5 LvQ0N2xbF4kKOHvQ488jduVhfMUoRWASQIJLFhKxpvIQeRNQwC5JgurI1lBvnLc8J8ev +WVgH9bYU+aCkFEuVObvD+U8YXbW2PKst1tTPsAIjDNPMDbGERERAkG3IuAsJAaexGii QsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=UeK2ju9mnsuM9YO/7SOXMISOHWMFGlUlTIJJVFv38bQ=; b=kMLn2p8NTS+smCagnZocSVhc+MU5htSg85HzOk10/6wgsB/yxAqag5UC5WrT92mx/Q dmdjGqoLdb2gndRdqVFbjZYcNMW3urgOm24Gnao38q2yuPkJ2rLY+8tnRKfrk4VphVwE KBPB58bMW2MS4BlM4yDSAodh0xv/QN6QxGkTARlOY74niAul3IapwKsMUY1pPS7t1ijx oKimy+JppB+0fkWmcniDkahcuK5sIqL2U/8nebHVJJM4TLJWcRZMYDlDHcpOBOtjWC3O vC16HSVnZDQepDb7/WitZbXjUvOP6gw5NxLxFFcRfV6aGDDDACzKEHxnsFBXQkf5PERN 17tw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c126-v6si3005361pfa.130.2018.07.13.08.33.45; Fri, 13 Jul 2018 08:34:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731366AbeGMPrf convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Jul 2018 11:47:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729762AbeGMPrf (ORCPT ); Fri, 13 Jul 2018 11:47:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ACC3E81663EE; Fri, 13 Jul 2018 15:32:27 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 875D110F1BE0; Fri, 13 Jul 2018 15:32:26 +0000 (UTC) Subject: Re: [PATCH v6 0/7] fs/dcache: Track & limit # of negative dentries To: James Bottomley , 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)" 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> <1531416833.18255.10.camel@HansenPartnership.com> From: Waiman Long Organization: Red Hat Message-ID: <919c5749-4528-ad30-28dd-a3ebb2c42021@redhat.com> Date: Fri, 13 Jul 2018 11:32:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1531416833.18255.10.camel@HansenPartnership.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 13 Jul 2018 15:32:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 13 Jul 2018 15:32:27 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/2018 01:33 PM, James Bottomley wrote: > 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? Sorry for being imprecise. What I meant is it is easy to find out which tasks issue the most I/O request and consume the most I/O bandwidth. IOW, which one we can blame if there are too much I/O activities. On the other hand, it is not that easy to find out which task generates the most negative dentries. >> 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 > I would say most system administrators don't want to have surprise. They don't want to see bad performance or other system problems and after some digging find out that some tasks are generating too much negative dentries and thus consuming too much memory, for example. They would certainly like to a way to notify them before the problems happen. Cheers, Longman