From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp01.aussiebb.com.au (smtp01.aussiebb.com.au [121.200.0.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E37713E02A for ; Mon, 14 Apr 2025 06:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=121.200.0.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744612138; cv=none; b=CdUqG0C7ctof9TZeceKdYvK4Xi6qBZV/etdiRm2YKgMHzu+ebnHHrofbaISSo08oCuFMiTmyes54o7rB8QmpoKk+MOCoiGK0d4Jy02PuDMPGYhzIi+FnfKnVfvgVB41ZNvvcYZumAruVLmAvXbqfjgDn7WDq6cpGFZSNLkWjUOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744612138; c=relaxed/simple; bh=pM+xHkllq+0pdjKdAUJYK4RU+5+4fhnJEdb+5cfHoUU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ofQLKAajPdVHglrrruIyo98H5fxAoI4ZVn5SRkmIlyCBIkFc7SQT1FxPVAaswxsQ+RfoK4IHaqrIS18OjcqkM3MwdkKKk3PIH2hKJPSi+5VEV0UmBHD1DQge1YpMPu9LvK+eaUtj9EFSWnMSAADsIthiTYm6zkcaT3HbTF0Wecg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=themaw.net; spf=fail smtp.mailfrom=themaw.net; arc=none smtp.client-ip=121.200.0.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=themaw.net Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=themaw.net Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp01.aussiebb.com.au (Postfix) with ESMTP id 102171010E5 for ; Mon, 14 Apr 2025 16:28:47 +1000 (AEST) X-Virus-Scanned: Debian amavisd-new at smtp01.aussiebb.com.au Received: from smtp01.aussiebb.com.au ([127.0.0.1]) by localhost (smtp01.aussiebb.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3C95qsIKJ0cj for ; Mon, 14 Apr 2025 16:28:47 +1000 (AEST) Received: by smtp01.aussiebb.com.au (Postfix, from userid 116) id 00D49100349; Mon, 14 Apr 2025 16:28:46 +1000 (AEST) X-Spam-Level: Received: from [192.168.0.229] (159-196-82-144.9fc452.per.static.aussiebb.net [159.196.82.144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ian146@aussiebb.com.au) by smtp01.aussiebb.com.au (Postfix) with ESMTPSA id 59AC71003AB; Mon, 14 Apr 2025 16:28:44 +1000 (AEST) Message-ID: <3c38cf85-d31d-4c46-b9f8-e801a39ca3ff@themaw.net> Date: Mon, 14 Apr 2025 14:28:42 +0800 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bad things when too many negative dentries in a directory To: Miklos Szeredi , Christian Brauner Cc: linux-fsdevel@vger.kernel.org, Al Viro , Amir Goldstein , Jan Kara References: <20250411-rennen-bleichen-894e4b8d86ac@brauner> Content-Language: en-US From: Ian Kent Autocrypt: addr=raven@themaw.net; keydata= xsFNBE6c/ycBEADdYbAI5BKjE+yw+dOE+xucCEYiGyRhOI9JiZLUBh+PDz8cDnNxcCspH44o E7oTH0XPn9f7Zh0TkXWA8G6BZVCNifG7mM9K8Ecp3NheQYCk488ucSV/dz6DJ8BqX4psd4TI gpcs2iDQlg5CmuXDhc5z1ztNubv8hElSlFX/4l/U18OfrdTbbcjF/fivBkzkVobtltiL+msN bDq5S0K2KOxRxuXGaDSh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a2hlsKUt3MLXbjEYL5OTSV2RtNP04KwlGS/xMfNwQf2O2aJoC4mSs4OeZwsHJFVF8rK XDvL/NzMCnysWCwjVIDhHBBIOC3mecYtXrasv9nl77LgffyyaAAQZz7yZcvn8puj9jH9h+mr L02W+gd+Sh6Grvo5Kk4ngzfT/FtscVGv9zFWxfyoQHRyuhk0SOsoTNYN8XIWhosp9GViyDtE FXmrhiazz7XHc32u+o9+WugpTBZktYpORxLVwf9h1PY7CPDNX4EaIO64oyy9O3/huhOTOGha nVvqlYHyEYCFY7pIfaSNhgZs2aV0oP13XV6PGb5xir5ah+NW9gQk/obnvY5TAVtgTjAte5tZ +coCSBkOU1xMiW5Td7QwkNmtXKHyEF6dxCAMK1KHIqxrBaZO27PEDSHaIPHePi7y4KKq9C9U 8k5V5dFA0mqH/st9Sw6tFbqPkqjvvMLETDPVxOzinpU2VBGhce4wufSIoVLOjQnbIo1FIqWg Dx24eHv235mnNuGHrG+EapIh7g/67K0uAzwp17eyUYlE5BMcwRlaHMuKTil6 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/4/25 23:40, Miklos Szeredi wrote: > On Fri, 11 Apr 2025 at 16:47, Christian Brauner wrote: > >> Note that we have a new sysctl: >> >> /proc/sys/fs/dentry-negative >> >> that can be used to control the negative dentry policy because any >> generic change that we tried to make has always resulted in unacceptable >> regressions for someone's workload. Currently we only allow it to be set >> to 1 (default 0). If set to 1 it will not create negative dentries >> during unlink. If that's sufficient than recommend this to users that >> suffer from this problem if not consider adding another sensitive >> policy. > Okay, I'll forward that info. > > However, hundreds of millions of negative dentries can be created > rather efficiently without unlink, though this one probably doesn't > happen under normal circumstances. Allowing this to starve the > scheduler for an arbitrary long time is not a good idea in any case, > so the fsnotify problem needs some other solution, and I suspect that > it's not to disable negative caching completely, as that would be a > major bummer. I know that the most recent case we have seen of this would probably be resolved by the sysctl but this was not the first recent case we had. Unfortunately I can't remember the details, all I remember is it was similar but not quite the same. In any case it's quite possible that many files can be processed, opened and then closed, not unlinked. So I think it's worth considering this as well. > > But the idea of leaving negative dentries off d_children is > independent of caching policy. The lookup cache would work fine > without d_sib being chained, it only needs careful thought in > > 1) putting the dentry on d_children when it's turned into positive > 2) getting the dentry off d_children when it's turned into negative. That shouldn't be too difficult to do ... sounds like a good idea to me. Ian