From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 497A1C433FE for ; Wed, 16 Mar 2022 02:07:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DB448D0002; Tue, 15 Mar 2022 22:07:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 963A08D0001; Tue, 15 Mar 2022 22:07:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DD728D0002; Tue, 15 Mar 2022 22:07:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 67C848D0001 for ; Tue, 15 Mar 2022 22:07:28 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D9E43A2AED for ; Wed, 16 Mar 2022 02:07:27 +0000 (UTC) X-FDA: 79248612534.21.B498A25 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf31.hostedemail.com (Postfix) with ESMTP id 331192000D for ; Wed, 16 Mar 2022 02:07:25 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0V7JsqWV_1647396439; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V7JsqWV_1647396439) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Mar 2022 10:07:22 +0800 Date: Wed, 16 Mar 2022 10:07:19 +0800 From: Gao Xiang To: Roman Gushchin Cc: Matthew Wilcox , Stephen Brennan , lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Gautham Ananthakrishna , khlebnikov@yandex-team.ru Subject: Re: [LSF/MM TOPIC] Better handling of negative dentries Message-ID: Mail-Followup-To: Roman Gushchin , Matthew Wilcox , Stephen Brennan , lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Gautham Ananthakrishna , khlebnikov@yandex-team.ru References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 331192000D X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=none; spf=pass (imf31.hostedemail.com: domain of hsiangkao@linux.alibaba.com designates 115.124.30.133 as permitted sender) smtp.mailfrom=hsiangkao@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Stat-Signature: kicfceprfisrshmaoqe1uexigyeidw1q X-Rspamd-Server: rspam07 X-HE-Tag: 1647396445-597188 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.001182, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Mar 15, 2022 at 01:56:18PM -0700, Roman Gushchin wrote: >=20 > > On Mar 15, 2022, at 12:56 PM, Matthew Wilcox wr= ote: > >=20 > > =EF=BB=BFThe number of negative dentries is effectively constrained o= nly by memory > > size. Systems which do not experience significant memory pressure fo= r > > an extended period can build up millions of negative dentries which > > clog the dcache. That can have different symptoms, such as inotify > > taking a long time [1], high memory usage [2] and even just poor look= up > > performance [3]. We've also seen problems with cgroups being pinned > > by negative dentries, though I think we now reparent those dentries t= o > > their parent cgroup instead. >=20 > Yes, it should be fixed already. >=20 > >=20 > > We don't have a really good solution yet, and maybe some focused > > brainstorming on the problem would lead to something that actually wo= rks. >=20 > I=E2=80=99d be happy to join this discussion. And in my opinion it=E2=80= =99s going beyond negative dentries: there are other types of objects whi= ch tend to grow beyond any reasonable limits if there is no memory pressu= re. +1, we once had a similar issue as well, and agree that is not only limited to negative dentries but all too many LRU-ed dentries and inodes. Limited the total number may benefit to avoid shrink spiking for servers. Thanks, Gao Xiang > A perfect example when it happens is when a machine is almost idle for = some period of time. Periodically running processes creating various kern= el objects (mostly vfs cache) which over time are filling significant por= tions of the total memory. And when the need for memory arises, we realiz= e that the memory is heavily fragmented and it=E2=80=99s costly to reclai= m it back. >=20 > Thanks!