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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 91EE9C43460 for ; Wed, 7 Apr 2021 10:30:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1E5CE61284 for ; Wed, 7 Apr 2021 10:30:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E5CE61284 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 81D026B007D; Wed, 7 Apr 2021 06:30:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A6FE6B007E; Wed, 7 Apr 2021 06:30:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 620736B0080; Wed, 7 Apr 2021 06:30:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 43AE76B007D for ; Wed, 7 Apr 2021 06:30:56 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E7443180ACF16 for ; Wed, 7 Apr 2021 10:30:55 +0000 (UTC) X-FDA: 78005202870.28.5708BCD Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf08.hostedemail.com (Postfix) with ESMTP id 5764D801A835 for ; Wed, 7 Apr 2021 10:30:48 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 14A80B0B3; Wed, 7 Apr 2021 10:30:54 +0000 (UTC) Subject: Re: [PATCH v3] mm: slub: move sysfs slab alloc/free interfaces to debugfs From: Vlastimil Babka To: Faiyaz Mohammed , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: vinmenon@codeaurora.org References: <1617712064-12264-1-git-send-email-faiyazm@codeaurora.org> <2e1f1771-0483-d311-7995-404c837372fc@suse.cz> Message-ID: <623f3165-4bce-8491-c9c4-8eac8404c21a@suse.cz> Date: Wed, 7 Apr 2021 12:30:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <2e1f1771-0483-d311-7995-404c837372fc@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5764D801A835 X-Stat-Signature: nfdtk5f184zqhhtgcgqmy4aop634b3ay X-Rspamd-Server: rspam02 Received-SPF: none (suse.cz>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1617791448-605498 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 4/6/21 7:15 PM, Vlastimil Babka wrote: > On 4/6/21 2:27 PM, Faiyaz Mohammed wrote: >> alloc_calls and free_calls implementation in sysfs have two issues, >> one is PAGE_SIZE limitiation of sysfs and other is it does not adhere >> to "one value per file" rule. >> >> To overcome this issues, move the alloc_calls and free_calls implemeation >> to debugfs. >> >> Signed-off-by: Faiyaz Mohammed > > Good direction, thanks. But I'm afraid we need a bit more: > > - I don't see debugfs_remove() (or _recursive) used anywhere. When a cache is > destroyed, do the dirs/files just linger in debugfs referencing removed > kmem_cache objects? > - There's a simple debugfs_create_dir(s->name, ...), for each cache while the > sysfs variant handles merged caches with symlinks etc. For consistency, the > hiearchy should look the same in debugfs as it does in sysfs. Oh and one more suggestion. With full seq_file API (unlike sysfs) we should really do the data gathering (to struct loc_track?) part just once per file open, and cache it between individual reads.