Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp187119ybj; Fri, 8 May 2020 09:21:15 -0700 (PDT) X-Google-Smtp-Source: APiQypL1t4kf7Q+JUB0JHG8Z5/qKs3vmBbHDGWm+ONVCsndkAenMSxIJVkRnCCavNLTkNCiLC+kz X-Received: by 2002:a50:e70a:: with SMTP id a10mr2984815edn.124.1588954875213; Fri, 08 May 2020 09:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588954875; cv=none; d=google.com; s=arc-20160816; b=eJqyqCnDqMJFggGpYbI2pqSfSCVdEZegP/C7KrnS4oQqP4LpP1+D61NlDhhNzs01kW swLv8qBUKx5bcldP5Rn8U7MRSSnVp2vPGMQbqO/Gq87Lk1lrOytEDBwLgSZLLVxDKNXy G9q5/DOZAxUtNo4UeVRZRdhP45qQ/NVMv2pnZjQrIAHD39HHTIsMT4US1fWRu9k4kFxi W0h93W3anpinifmTPqMnujtDBvJ8rFr1TNRUB31nCAAyiIEgV3vWX4VsbS5vO+qboVrm pWaqj4236llwkWzsf5URg2ZveuOsR9ofsWc/Yr9sa706BRGxGjhdRJFPaIaoidpGoXNC EA7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=fBUtwXBek4NM+L2c+v6a5Q30Xgg4O7DzdNaSB/H01/M=; b=BPZCekTJ9qP0rIxcn1DrGW+FV5YokJV5CMkPk0RXTZp4n9FyvwXhJMY5gxX7WzYCEm QklStWR+E5sc2QBAjp1BqUX+Kxe8WrvhcbSiDKzkILq4ogDFvV+SbL9zRiI3NRxeL63N 2gzjhsIQAy7wKDNpqwJOuJGY+++UXPQi4AV2ybwA7q3zNaaw2mB6Yky8AtO1IjighRUm JK7MFXNayE0+d7T/9aMjqElSYoFBA1azS+0qgA0fC1OsV6E5pYazNjdy3h4OY5Qw57Ow 9xYSER0MAlKpVHRPbKltIQCVT5o74e7dAwKv55wVF4UogOyihE6pCe7QWdSDa5ehd24r awkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=dAECvcdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq14si1100525ejb.42.2020.05.08.09.20.51; Fri, 08 May 2020 09:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=dAECvcdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728641AbgEHQQt (ORCPT + 99 others); Fri, 8 May 2020 12:16:49 -0400 Received: from forwardcorp1p.mail.yandex.net ([77.88.29.217]:50852 "EHLO forwardcorp1p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728174AbgEHQQq (ORCPT ); Fri, 8 May 2020 12:16:46 -0400 Received: from mxbackcorp1g.mail.yandex.net (mxbackcorp1g.mail.yandex.net [IPv6:2a02:6b8:0:1402::301]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id 1DA522E14C4; Fri, 8 May 2020 19:16:43 +0300 (MSK) Received: from myt4-18a966dbd9be.qloud-c.yandex.net (myt4-18a966dbd9be.qloud-c.yandex.net [2a02:6b8:c00:12ad:0:640:18a9:66db]) by mxbackcorp1g.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id FUmgX13TVC-GeAWkgPx; Fri, 08 May 2020 19:16:43 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1588954603; bh=fBUtwXBek4NM+L2c+v6a5Q30Xgg4O7DzdNaSB/H01/M=; h=In-Reply-To:References:Date:Message-ID:From:To:Subject; b=dAECvcdKmUWk2CVnMXeTHO8Vk04t0GhdKk6GVVazxHMmEd4vqdRBdWvIWqkI271c7 CSAWWDV/ZA13LhBGUZXu96IhmqX7dtLDQOdPEN9crnTRzNnC73pXVD2TgYv1vXjxGT 5ykQhY615zHDuCC3cU53VoEyWgY+W+NlFyLvCwzM= Authentication-Results: mxbackcorp1g.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:7008::1:4]) by myt4-18a966dbd9be.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id qhpQEsyI8M-GeWCH2g5; Fri, 08 May 2020 19:16:40 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: [PATCH RFC 1/8] dcache: show count of hash buckets in sysctl fs.dentry-state To: Waiman Long , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Alexander Viro References: <158893941613.200862.4094521350329937435.stgit@buzz> <158894059427.200862.341530589978120554.stgit@buzz> <7c1cef87-2940-eb17-51d4-cbc40218b770@redhat.com> From: Konstantin Khlebnikov Message-ID: Date: Fri, 8 May 2020 19:16:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <7c1cef87-2940-eb17-51d4-cbc40218b770@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/2020 17.49, Waiman Long wrote: > On 5/8/20 8:23 AM, Konstantin Khlebnikov wrote: >> Count of buckets is required for estimating average length of hash chains. >> Size of hash table depends on memory size and printed once at boot. >> >> Let's expose nr_buckets as sixth number in sysctl fs.dentry-state > > The hash bucket count is a constant determined at boot time. Is there a need to use up one dentry_stat entry for that? Besides one can get > it by looking up the kernel dmesg log like: > > [    0.055212] Dentry cache hash table entries: 8388608 (order: 14, 67108864 bytes) Grepping logs since boot time is a worst API ever. dentry-state shows count of dentries in various states. It's very convenient to show count of buckets next to it, because this number defines overall scale. > > Cheers, > Longman >