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 2FE10C38A2A for ; Fri, 8 May 2020 20:00:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E574220A8B for ; Fri, 8 May 2020 20:00:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z1Ov5hpq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E574220A8B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F788900009; Fri, 8 May 2020 16:00:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77F63900004; Fri, 8 May 2020 16:00:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BD6D900009; Fri, 8 May 2020 16:00:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id 559ED900004 for ; Fri, 8 May 2020 16:00:15 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0B1AD181AEF1D for ; Fri, 8 May 2020 20:00:15 +0000 (UTC) X-FDA: 76794618390.08.test74_221c892c4c32 X-HE-Tag: test74_221c892c4c32 X-Filterd-Recvd-Size: 4650 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 20:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588968014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XcJYYGDxYUxU0RX7aa3X/KiDcquP9abnqc3PijumMy4=; b=Z1Ov5hpq1smm5wZP8jDnWU/XAwoTMOcetwxNR2bdlYijkbTkYwrh9Jw9SzibWnboYAHIL+ NOsV7pk96VYg0xYlk2Qt3wmtTucj89QNa8uTFsw1Us761Rd3F2XHTyHO29wd7RzA1M7hQi w293XOm1twzq08k+88OsYHTF18rkGWo= 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-500-L3-e7MSpOJmw5tlWsXZj_Q-1; Fri, 08 May 2020 16:00:11 -0400 X-MC-Unique: L3-e7MSpOJmw5tlWsXZj_Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 254501800D42; Fri, 8 May 2020 20:00:10 +0000 (UTC) Received: from llong.remote.csb (ovpn-117-83.rdu2.redhat.com [10.10.117.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26BD61E4; Fri, 8 May 2020 20:00:09 +0000 (UTC) Subject: Re: [PATCH RFC 1/8] dcache: show count of hash buckets in sysctl fs.dentry-state To: Konstantin Khlebnikov , 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> <1f137f70-3d37-eb70-2e85-2541e504afbd@yandex-team.ru> From: Waiman Long Organization: Red Hat Message-ID: <34ed1b12-1bee-8158-3084-fb1059b6686a@redhat.com> Date: Fri, 8 May 2020 16:00:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1f137f70-3d37-eb70-2e85-2541e504afbd@yandex-team.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 5/8/20 3:38 PM, Konstantin Khlebnikov wrote: > > > 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=20 >>>>> 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=20 >>>> there a need to use up one dentry_stat entry for that? Besides one=20 >>>> can get it by looking up the kernel dmesg log like: >>>> >>>> [=C2=A0=C2=A0=C2=A0 0.055212] Dentry cache hash table entries: 83886= 08 (order: 14,=20 >>>> 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 >> >> I am not against using the last free entry for that. My only concern=20 >> 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=20 >> can 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 els= e? > > 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 Well, I got rebuke the last time I want to reuse one of=20 age_limit/want_pages entry for negative dentry count because of the=20 potential of breaking some really old applications or tools. Changing=20 dentry-state to output one more number can potentially break=20 compatibility too. That is why I am questioning if it is a good idea to=20 use up the last free slot. Cheers, Longman