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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 55380C47257 for ; Fri, 8 May 2020 19:38:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C7C97218AC for ; Fri, 8 May 2020 19:38:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=yandex-team.ru header.i=@yandex-team.ru header.b="OvTf+PpX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7C97218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=yandex-team.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EC17900002; Fri, 8 May 2020 15:38:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19C798E0003; Fri, 8 May 2020 15:38:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B25D900002; Fri, 8 May 2020 15:38:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id E756D8E0003 for ; Fri, 8 May 2020 15:38:15 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A16EF180AD806 for ; Fri, 8 May 2020 19:38:15 +0000 (UTC) X-FDA: 76794562950.15.drop16_651163d416b0a X-HE-Tag: drop16_651163d416b0a X-Filterd-Recvd-Size: 4027 Received: from forwardcorp1j.mail.yandex.net (forwardcorp1j.mail.yandex.net [5.45.199.163]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 19:38:14 +0000 (UTC) Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id D9AE22E1311; Fri, 8 May 2020 22:38:11 +0300 (MSK) Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id QvZdULVM6o-cAX4svEI; Fri, 08 May 2020 22:38:11 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1588966691; bh=9GLY1la68n+wI9zMyvgvDRv2pNDwrtlhLHG5G0IMGTs=; h=In-Reply-To:References:Date:Message-ID:From:To:Subject; b=OvTf+PpXtk7c6havdRnlXu1hosHaar/Pj5/xkLONgMgc//ZOb4TQlntz2NNbxteoP nKGm5QpGYYrY3oPg5vhtBUmNC3ZrUyU2Prue+3JmKRuePDd0LSYlSdt5z2pgxoN0ir flbJfpFua4c+p7FkDT2Vfv1JSxMI3cdGMEwJaJ7M= Authentication-Results: mxbackcorp2j.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:7114::1:3]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id jDpMf4G7CS-cAWSORw7; Fri, 08 May 2020 22:38:10 +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> <741172f7-a0d2-1428-fb25-789e38978d4e@redhat.com> From: Konstantin Khlebnikov Message-ID: <1f137f70-3d37-eb70-2e85-2541e504afbd@yandex-team.ru> Date: Fri, 8 May 2020 22:38:10 +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: <741172f7-a0d2-1428-fb25-789e38978d4e@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08/05/2020 22.05, Waiman Long wrote: > On 5/8/20 12:16 PM, Konstantin Khlebnikov wrote: >> 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 c= hains. >>>> 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=20 >>> get it by looking up the kernel dmesg log like: >>> >>> [=C2=A0=C2=A0=C2=A0 0.055212] Dentry cache hash table entries: 838860= 8 (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.=20 >=20 > I am not against using the last free entry for that. My only concern is= when we want to expose another internal dcache data point via=20 > dentry-state, we will have to add one more number to the array which ca= n cause all sort of compatibility problem. So do we want to use the=20 > last free slot for a constant that can be retrieved from somewhere else= ? I see no problem in adding more numbers into sysctl. Especially into such rarely used. This interface is designed for that. Also fields 'age_limit' and 'want_pages' are unused since kernel 2.2.0 >=20 > Cheers, > Longman >=20