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 73C2FC4743E for ; Mon, 7 Jun 2021 02:40:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0994F611CE for ; Mon, 7 Jun 2021 02:40:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0994F611CE 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 613016B006C; Sun, 6 Jun 2021 22:40:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 589706B006E; Sun, 6 Jun 2021 22:40:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DC436B0070; Sun, 6 Jun 2021 22:40:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 082046B006C for ; Sun, 6 Jun 2021 22:40:41 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 848FF180AD802 for ; Mon, 7 Jun 2021 02:40:41 +0000 (UTC) X-FDA: 78225374682.13.CE16AC6 Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by imf26.hostedemail.com (Postfix) with ESMTP id B309A4202A0C for ; Mon, 7 Jun 2021 02:40:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623033641; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=xHinzKFF8Oq4e1JnuTklnALpXRLLUFGz0QJ4HBYNDIw=; b=pfLuYFp2C69qWgNR0WxcUDkOpSZ5XyL4mX5SJiDe7gZzIWfAvbc1zXssDgXNhLy40fQuGbUy FwQ4wjAWt0/Dzu5mGxjB0A22WJQI2awB2ZMG1OV+hTVaFe0a3goH0zAM/4Xigv6Ei1x513Re WBhuscIOZUFj5FqtpDfzEEhrB78= X-Mailgun-Sending-Ip: 69.72.43.7 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-n04.prod.us-west-2.postgun.com with SMTP id 60bd870eea2aacd72952f0ab (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 07 Jun 2021 02:40:14 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C6591C433F1; Mon, 7 Jun 2021 02:40:14 +0000 (UTC) Received: from [192.168.0.105] (unknown [49.204.182.5]) (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 CA26CC433D3; Mon, 7 Jun 2021 02:40:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CA26CC433D3 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 08:10:06 +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 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=mg.codeaurora.org header.s=smtp header.b=pfLuYFp2; spf=pass (imf26.hostedemail.com: domain of bounce@mg.codeaurora.org designates 69.72.43.7 as permitted sender) smtp.mailfrom=bounce@mg.codeaurora.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B309A4202A0C X-Stat-Signature: rzafogisy4hjb1fh8nr63q9ehciaj71y X-HE-Tag: 1623033637-643833 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 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 >=20 > limitation >=20 >> to "one value per file" rule. >> >> To overcome this issues, move the alloc_calls and free_calls implemeat= ion >=20 > implementation >=20 >> 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. > ... >=20 >> +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB_DEBUG) >> +void debugfs_slab_release(struct kmem_cache *); >> +#else >=20 >> +static inline void debugfs_slab_release(struct kmem_cache *s) >> +{ >> +} >=20 > It can be one line. >=20 >> +#endif >=20 > ... >=20 >=20 >> + if (l->sum_time !=3D l->min_time) { >> + seq_printf(seq, " age=3D%ld/%ld/%ld", >> + l->min_time, >=20 >> + (long)div_u64(l->sum_time, l->count), >=20 > Hmm... Why is the cast needed here? >=20 To avoid below warning while preparing build for arm/32 bit, "format =E2=80=98%ld=E2=80=99 expects argument of type =E2=80=98long int=E2= =80=99, but argument 4 has type =E2=80=98u64 {aka long long unsigned int}" . >> + l->max_time); >> + } else >> + seq_printf(seq, " age=3D%ld", >> + l->min_time); >=20 > ... >=20 >> + if (num_online_cpus() > 1 && >> + !cpumask_empty(to_cpumask(l->cpus))) >=20 > One line? >=20 > ... >=20 >> +static const struct seq_operations slab_debugfs_sops =3D { >> + .start =3D slab_debugfs_start, >> + .next =3D slab_debugfs_next, >> + .stop =3D slab_debugfs_stop, >=20 >> + .show =3D slab_debugfs_show >=20 > Leave a comma here. It might not be the last one in the future. >=20 >> +}; >=20 > + blank line? >=20 >> +static int slab_debug_trace_open(struct inode *inode, struct file *fi= lep) >> +{ >=20 > ... >=20 >> +static const struct file_operations slab_debugfs_fops =3D { >> + .open =3D slab_debug_trace_open, >> + .read =3D seq_read, >> + .llseek =3D seq_lseek, >> + .release =3D slab_debug_trace_release, >> +}; >> + >> + >=20 > One blank line is enough. >=20 > ... >=20 >> + debugfs_remove_recursive(debugfs_lookup(s->name, >> + slab_debugfs_root)); >=20 > One line? >=20 Will update other comments in next patch. Thanks and regards, Mohammed Faiyaz