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 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFDC6C2D0F0 for ; Wed, 1 Apr 2020 15:51:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD57A20658 for ; Wed, 1 Apr 2020 15:51:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c2ypOqQp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733172AbgDAPv4 (ORCPT ); Wed, 1 Apr 2020 11:51:56 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26265 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732965AbgDAPv4 (ORCPT ); Wed, 1 Apr 2020 11:51:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585756314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9Hue9l1/UJQF2U4lKyhSbPFzaMnHT5K5mJD7PcBNrM4=; b=c2ypOqQpiZB+D9K0IxvRsf2huk/tx7a+qg27vupMRMBFb0oSk0TFcMeyo6+LLabjXxEEkz gt27cysjL68cE7KsZUYdOdTfEINfktwxA+Oq/IBQYE21ZGXqQRyIQXebJ4WTS+Xozg24FX KYt7exPiHq3QvK+/3ZLn9u1gSkv5veA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-W2iZb2t4MKawS3j31oos7A-1; Wed, 01 Apr 2020 11:51:53 -0400 X-MC-Unique: W2iZb2t4MKawS3j31oos7A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1338113F7; Wed, 1 Apr 2020 15:51:48 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-114-243.ams2.redhat.com [10.36.114.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id D631696B87; Wed, 1 Apr 2020 15:51:43 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <158454408854.2864823.5910520544515668590.stgit@warthog.procyon.org.uk> <50caf93782ba1d66bd6acf098fb8dcb0ecc98610.camel@themaw.net> <2465266.1585729649@warthog.procyon.org.uk> To: Miklos Szeredi Cc: dhowells@redhat.com, Ian Kent , Linus Torvalds , Al Viro , Linux NFS list , Andreas Dilger , Anna Schumaker , "Theodore Ts'o" , Linux API , linux-ext4@vger.kernel.org, Trond Myklebust , Miklos Szeredi , Christian Brauner , Jann Horn , "Darrick J. Wong" , Karel Zak , Jeff Layton , linux-fsdevel@vger.kernel.org, LSM , linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/13] VFS: Filesystem information [ver #19] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2583799.1585756303.1@warthog.procyon.org.uk> Date: Wed, 01 Apr 2020 16:51:43 +0100 Message-ID: <2583800.1585756303@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos Szeredi wrote: > For 30000 mounts, f= 146400us f2= 136766us p= 1406569us p2= > 221669us; p=9.6*f p=10.3*f2 p=6.3*p2 f = 146400us f2= 136766us p = 1406569us <--- Order of magnitude slower p2= 221669us And more memory used because it's added a whole bunch of inodes and dentries to the cache. For each mount that's a pair for each dir and a pair for each file within the dir. So for the two files my test is reading, for 30000 mounts, that's 90000 dentries and 90000 inodes in mountfs alone. (gdb) p sizeof(struct dentry) $1 = 216 (gdb) p sizeof(struct inode) $2 = 696 (gdb) p (216*696)*30000*3/1024/1024 $3 = 615 so 615 MiB of RAM added to the caches in an extreme case. We're seeing customers with 10000+ mounts - that would be 205 MiB, just to read two values from each mount. I presume you're not going through /proc/fdinfo each time as that would add another d+i - for >1GiB added to the caches for 30000 mounts. David