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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 33D39C47082 for ; Mon, 7 Jun 2021 14:13:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AABEB6108E for ; Mon, 7 Jun 2021 14:13:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AABEB6108E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB54E6B0036; Mon, 7 Jun 2021 10:13:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3CA26B006E; Mon, 7 Jun 2021 10:13:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8F506B0070; Mon, 7 Jun 2021 10:13:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 8F7E56B0036 for ; Mon, 7 Jun 2021 10:13:35 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 271F56137 for ; Mon, 7 Jun 2021 14:13:35 +0000 (UTC) X-FDA: 78227120790.15.6A3BA80 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) by imf20.hostedemail.com (Postfix) with ESMTP id C3B89552 for ; Mon, 7 Jun 2021 14:13:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623075214; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=Su/cq0k1ylesxhJXGbs0jmsD+IHmtamWDm3Jh1ynG/8=; b=CZKICHLhVkT9QfMbNIDHxod6NPawDbwp5Hgc/D77TRKwA/QkTtPG5xCB39fghWIAxscY1nag DMUiw6Wro4mzfXBC2NuZ4qTUTdZyZnD1u6dKmEMfDAK0TIQ+DZ7Lp/8g3/ja36zs304ZyH3G K4T36aZxZeZa1cfqJpFMgPUUzoU= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 60be252af726fa41881ff26b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 07 Jun 2021 13:54:50 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5B7D5C4360C; Mon, 7 Jun 2021 13:54:49 +0000 (UTC) Received: from [192.168.121.187] (unknown [27.59.137.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: faiyazm) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0FF56C433D3; Mon, 7 Jun 2021 13:54:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0FF56C433D3 Subject: Re: [PATCH v10] mm: slub: move sysfs slab alloc/free interfaces to debugfs To: Andy Shevchenko Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , linux-mm , Linux Kernel Mailing List , Greg KH , glittao@gmail.com, vinmenon@codeaurora.org References: <1622996045-25826-1-git-send-email-faiyazm@codeaurora.org> From: Faiyaz Mohammed Message-ID: Date: Mon, 7 Jun 2021 19:24:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=mg.codeaurora.org header.s=smtp header.b=CZKICHLh; spf=pass (imf20.hostedemail.com: domain of bounce@mg.codeaurora.org designates 198.61.254.9 as permitted sender) smtp.mailfrom=bounce@mg.codeaurora.org; dmarc=none X-Stat-Signature: 1s56gxmsiukp1w6ry9ob5n8w1b73psp4 X-Rspamd-Queue-Id: C3B89552 X-Rspamd-Server: rspam06 X-HE-Tag: 1623075209-236087 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 6/7/2021 2:01 AM, Andy Shevchenko wrote: > On Sun, Jun 6, 2021 at 7:16 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 > > limitation > >> to "one value per file" rule. >> >> To overcome this issues, move the alloc_calls and free_calls implemeation > > implementation > >> to debugfs. >> >> Debugfs cache will be created if SLAB_STORE_USER flag is set. >> >> Rename the alloc_calls/free_calls to alloc_traces/free_traces, >> to be inline with what it does. > > ... > >> +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB_DEBUG) >> +void debugfs_slab_release(struct kmem_cache *); >> +#else > >> +static inline void debugfs_slab_release(struct kmem_cache *s) >> +{ >> +} > > It can be one line. > >> +#endif > > ... > > >> + if (l->sum_time != l->min_time) { >> + seq_printf(seq, " age=%ld/%ld/%ld", >> + l->min_time, > >> + (long)div_u64(l->sum_time, l->count), > > Hmm... Why is the cast needed here? > >> + l->max_time); >> + } else >> + seq_printf(seq, " age=%ld", >> + l->min_time); > > ... > >> + if (num_online_cpus() > 1 && >> + !cpumask_empty(to_cpumask(l->cpus))) > > One line? > I have split the line because it is crossing the 80 columns. In this case it's okay to cross 80 columns? > ... > >> +static const struct seq_operations slab_debugfs_sops = { >> + .start = slab_debugfs_start, >> + .next = slab_debugfs_next, >> + .stop = slab_debugfs_stop, > >> + .show = slab_debugfs_show > > Leave a comma here. It might not be the last one in the future. > >> +}; > > + blank line? > >> +static int slab_debug_trace_open(struct inode *inode, struct file *filep) >> +{ > > ... > >> +static const struct file_operations slab_debugfs_fops = { >> + .open = slab_debug_trace_open, >> + .read = seq_read, >> + .llseek = seq_lseek, >> + .release = slab_debug_trace_release, >> +}; >> + >> + > > One blank line is enough. > > ... > >> + debugfs_remove_recursive(debugfs_lookup(s->name, >> + slab_debugfs_root)); > > One line? > Same here!