Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3279169pxj; Mon, 7 Jun 2021 06:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzgt9Ss6o6+6isY1TcUpGBfrmfL19RaNKEFofuxNXy8DD7a61bHagizZIScBScUXqhI29T X-Received: by 2002:a17:906:9486:: with SMTP id t6mr17672904ejx.271.1623074236885; Mon, 07 Jun 2021 06:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623074236; cv=none; d=google.com; s=arc-20160816; b=LjjGnlEqHKCsOJYqYUtdM8qi0lWeVAhH4Khm7xjuggTFPPNmNPG4lfTLk7CX/+uodd RZj7L06RhJQf6zFIjJeagBkWWJswknoIf4+32mq0w/+EmJS7X4ur9BJ+CWHdfPqfI/l9 DDoea4PCz3QTOk4pGLUjXcp3/u/w1vFVT1DvAvnvpP9wHUD2V/QgiNNsMrTcELM6Wm3z t1pI2K8+TyPyR//Ku/02+XJ9sfc/yHU88GHg03lKpxl2vj59ACgKa8tLvldK+MZ1+z4s XJMfvLw5JoB2CAomEWn4ntOVp7bmGZmEnKFfdWDXd/FcrCxj4vBCZUzKMy8fKPji/Mga c4hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=Su/cq0k1ylesxhJXGbs0jmsD+IHmtamWDm3Jh1ynG/8=; b=purFO6Z0zoP9kPf7DLn897NQMNsfgzh27nlscqe/eUf6cwRCTu2Gqi7+qHjdmbZ9+W 6yILAqcLMUlRpgJXbYBGwkzrUQKgaX1ijRjpOAQK2RO4uUTXODIJWVojfsgXv7gJ1n0/ gCqJmaDm5MRLIXAMwurlhZXqp3Yk8BCc/c2RFGvBqxC0n0OUQ0q4xsRdK0v/ecLF1y3h VgsgdkcIqsFHDo0FnAvGSIpt1Sk7KJLS3TJ5l+eVAhIqpQLfMEru0XrhUqEHVHmBBSNB qC+jUbzd3OFi4MwGxJcHn8BARkq3pNS+pKWnkDTl8KkSvHLqxp6jsLUw9LtW+4KcPB3z BacA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=MlFbveAA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z40si13009216ede.300.2021.06.07.06.56.54; Mon, 07 Jun 2021 06:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=MlFbveAA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbhFGN5O (ORCPT + 99 others); Mon, 7 Jun 2021 09:57:14 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:49641 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbhFGN5O (ORCPT ); Mon, 7 Jun 2021 09:57:14 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623074123; 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=MlFbveAA4nK1w2cZTqFODcMfYa9/nkOK54JjHhBw9XgpkxZkAdENVjWk0QEc0nk7mv5Oc9+Q Z3XGCE6NuHfOFHA/TgBp2lxjBWQcJN4jIyU+FeD8R4LCedlhW2Te9wyhV5NcHKVzAJJ480xH vASjKoXDHa3YSUh1gxb0HLulJbI= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 60be252a6ddc3305c4390d03 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 07 Jun 2021 13:54:50 GMT Sender: faiyazm=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 989C2C43148; Mon, 7 Jun 2021 13:54:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 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 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=faiyazm@codeaurora.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!