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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E2EA0C433E0 for ; Fri, 19 Mar 2021 06:54:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5EE7264F6C for ; Fri, 19 Mar 2021 06:54:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EE7264F6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5DC456B006E; Fri, 19 Mar 2021 02:54:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5637D6B0071; Fri, 19 Mar 2021 02:54:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DD9F6B0072; Fri, 19 Mar 2021 02:54:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 1ECCE6B006E for ; Fri, 19 Mar 2021 02:54:44 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CD183943E for ; Fri, 19 Mar 2021 06:54:43 +0000 (UTC) X-FDA: 77935710846.32.0D879D5 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP id 0D01713A for ; Fri, 19 Mar 2021 06:54:42 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 5595064F69; Fri, 19 Mar 2021 06:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616136878; bh=TKQ56swMqHQadyvtwM2XNqltSyQDnJm/1l8vKBlQ4vg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0XsqAG3W/YlQB9OubbvYA+GHr5NBe6YU9bxJJfMklYgtU6uGBLCbpeuJJFXs7YKBD f8UJYx0hNC4nMq4pqjQLmprjTA1O6XsWd/yEQIgZ3aRno/rBk/YSIXLEzlZVs3kMGT 0jGyL64+qbV0Wn1SQHCqAX1vT9g8Rm3TK22LjGqw= Date: Fri, 19 Mar 2021 07:54:36 +0100 From: Greg Kroah-Hartman To: Faiyaz Mohammed Cc: Vlastimil Babka , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, willy@infradead.org, vinmenon@codeaurora.org, Peter Zijlstra , linux-mm@kvack.org Subject: Re: [PATCH v2] mm: slub: Convert sys slab alloc_calls, free_calls to bin attribute Message-ID: References: <1613543513-11965-1-git-send-email-faiyazm@codeaurora.org> <13df1c88-3848-1969-5424-33a927ec033e@suse.cz> <3ac1d3e6-6207-96ad-16a1-0f5139d8b2b5@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ac1d3e6-6207-96ad-16a1-0f5139d8b2b5@codeaurora.org> X-Stat-Signature: uscjyo3g1aregak3zi6f9xpwytypxwjq X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0D01713A Received-SPF: none (linuxfoundation.org>: No applicable sender policy available) receiver=imf12; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616136882-457495 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 Fri, Mar 19, 2021 at 10:58:55AM +0530, Faiyaz Mohammed wrote: > Hi, > > Sorry for late response! > > On 3/2/2021 6:41 PM, Greg Kroah-Hartman wrote: > > On Tue, Mar 02, 2021 at 01:59:46PM +0100, Vlastimil Babka wrote: > >> On 2/17/21 7:31 AM, Faiyaz Mohammed wrote: > >>> Reading the sys slab alloc_calls, free_calls returns the available object > >>> owners, but the size of this file is limited to PAGE_SIZE > >>> because of the limitation of sysfs attributes, it is returning the > >>> partial owner info, which is not sufficient to debug/account the slab > >>> memory and alloc_calls output is not matching with /proc/slabinfo. > >>> > >>> To remove the PAGE_SIZE limitation converted the sys slab > >>> alloc_calls, free_calls to bin attribut > >>> > >>> Signed-off-by: Faiyaz Mohammed > >> > >> After discussing this with Greg and PeterZ, sysfs should be one value per file, > >> and is just not proper API for this kind of info. We should reimplement at least > >> these clearly debugging "attributes" in debugfs, where they belong, instead of > >> trying to hack around the limitation in sysfs. > > > > sysfs is _REQUIRED_ to be "one value per file", any kernel code that > > abuses this needs to be fixed up. > > > > Why are these slab files in sysfs at all anyway? They all feel like > > debugging stuff to me, why not move everything to debugfs? Would make > > for a lot less code overall. > > > Yes, we can move the /sys/kernel/slab/kmemcache/alloc_calls and > /sys/kernel/slab/kmemcache/free_calls implementation to debugfs but is > it okay to move only alloc_calls and free_calls? or we have to move > whole sysfs interface to debugfs?. sysfs files should only have "one value" in them. Anything that violates that rule, should be moved to debugfs. thanks, greg k-h