Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp215051ybf; Thu, 27 Feb 2020 19:34:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwC9glJ7VW1Ipcs6VhmP6Pct8h5XCIGludpB08XGsxOUxcDLawmDx+TIBQ8hLeYqPW1mA2Y X-Received: by 2002:aca:5447:: with SMTP id i68mr1651089oib.31.1582860876241; Thu, 27 Feb 2020 19:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582860876; cv=none; d=google.com; s=arc-20160816; b=LU5e0CFUhPJG6UTC1Ey8vSBuU6aQlEQl8Ao3J3Mi/m1tQfuFWd18BaXz7AGlF6MztF tu3kA+Ss3Ig81uLCkZnsZdkylFFXtK7REvUF3QujUEpj7KbFjTuYtTJLWYKId7Gr1f6l pwUniA8J2PVlP539kEVDvtkHPSmY0TrjUeNDRQHGIsQ4t5LdaroJ6acw8woOEuWhLdJo PK9bhm03iHANX14fPukrUWldQ4/FlnCK7FGOlDBb72K3O4Ga4RJTLh9YGkNqbw8yrb/J Sz2rySAMmLDGr1Bk3IDG7Y9RCuA0btj6eYiwpFrsIYEYDC8e/NbtmG3LVPOXR9IR2e/r Ytag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8ohWsBNybdoUlsH9268dif1L9MEaj5QT7JAO8j1ggLc=; b=uqbhdGsN5nM9nBJ7hlRgZVhZrsx/win19ZWig2arOijSePZDLf2r7UqfjgZFq7tWQY iw6bK+5SCf3ydUD+XBkzy4dKSjbIytkZ6vec2KLPhRh9vHSVUZtAkakBF0TVsf7vBfZx AfA2zE25SUltOAv6iH5ChtE8rq0HKGf2xEDq1WgJvpog4a1sWsWuQm169tfCKXSqcEeL AeiHxojoCjOXyhloPxeuyjSpSKDR8bvBz4KwGFyqFulaAkGafIX1ZpQPk/Aft5Wnz1ze G6uvMDLY/0q2NFLijbQ0nHbUhqq4SFnIFwCZHR2ukRY0ZtauNq/c5fvnBVs1hHuEQ/pS Xp5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Bd791Ixi; 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 l25si844353otq.76.2020.02.27.19.34.24; Thu, 27 Feb 2020 19:34:36 -0800 (PST) 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=@infradead.org header.s=bombadil.20170209 header.b=Bd791Ixi; 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 S1730733AbgB1DeU (ORCPT + 99 others); Thu, 27 Feb 2020 22:34:20 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41658 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730638AbgB1DeT (ORCPT ); Thu, 27 Feb 2020 22:34:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8ohWsBNybdoUlsH9268dif1L9MEaj5QT7JAO8j1ggLc=; b=Bd791Ixini1pwewoL2V9vEiHTl xbdtRGLm8B+bBqUJvH8F9vnusQAImUKO3DvyUVsUFB5at16CO4xiM2a16YujtnqTUV6fBuQwDqsJg vbXEKlTxmXsD2dAMAl3yqiO7rQdvBMSeltt79eRQgjkE+o0DPBieLMdG6WLVt5NArdeChc4o5ix9k 7/fEAVGXho0E/oWy5es6qshWghH/Yy7ggoSNr2UyTQj8JRSBBoVvpVFGQiGezil6RA4OuH0KLiiBX 7puBjkRprI2OixIexMypB1eRkx67+XRiHaLYqnMiDXYp9tDCGOXpCiSNxV4H7DNJCUByG2zLRY/aS vPHSUE1w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7WPk-0003d7-Dn; Fri, 28 Feb 2020 03:34:12 +0000 Date: Thu, 27 Feb 2020 19:34:12 -0800 From: Matthew Wilcox To: Ian Kent Cc: Andreas Dilger , Waiman Long , Alexander Viro , Jonathan Corbet , Luis Chamberlain , Kees Cook , Iurii Zaikin , Linux Kernel Mailing List , Linux FS Devel , linux-doc@vger.kernel.org, Mauro Carvalho Chehab , Eric Biggers , Dave Chinner , Eric Sandeen Subject: Re: [PATCH 00/11] fs/dcache: Limit # of negative dentries Message-ID: <20200228033412.GD29971@bombadil.infradead.org> References: <20200226161404.14136-1-longman@redhat.com> <20200226162954.GC24185@bombadil.infradead.org> <2EDB6FFC-C649-4C80-999B-945678F5CE87@dilger.ca> <9d7b76c32d09492137a253e692624856388693db.camel@themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d7b76c32d09492137a253e692624856388693db.camel@themaw.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 05:55:43PM +0800, Ian Kent wrote: > Not all file systems even produce negative hashed dentries. > > The most beneficial use of them is to improve performance of rapid > fire lookups for non-existent names. Longer lived negative hashed > dentries don't give much benefit at all unless they suddenly have > lots of hits and that would cost a single allocation on the first > lookup if the dentry ttl expired and the dentry discarded. > > A ttl (say jiffies) set at appropriate times could be a better > choice all round, no sysctl values at all. The canonical argument in favour of negative dentries is to improve application startup time as every application searches the library path for the same libraries. Only they don't do that any more: $ strace -e file cat /dev/null execve("/bin/cat", ["cat", "/dev/null"], 0x7ffd5f7ddda8 /* 44 vars */) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/dev/null", O_RDONLY) = 3 So, are they still useful? Or should we, say, keep at most 100 around?