Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1397119pxj; Fri, 21 May 2021 13:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVxs/YepofkhKp3DqH6J2fs0qO6QUltV00tUgulN2AaKARDyY7mLAl0iDamXPQwNKU+fof X-Received: by 2002:a05:6e02:e10:: with SMTP id a16mr575003ilk.56.1621628048099; Fri, 21 May 2021 13:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628048; cv=none; d=google.com; s=arc-20160816; b=jUwaR7PiXVCrJmhszudU9E11nKP6JX9hk2+1XkZMTsy6AJEgyrwmcoTUJNZEM+PRfY fv6+WoR2pi8GOTgsCtU8VSPmg0Fqg9uHAAtfU3Ez71HW9sRhQWjRIiG5oPq4y6PEl2c6 GD+Ix94KqzpM6BBgxnoepgTkN6kOPaTFmfqRIAXEPoVvnCE0org2YaYtRgeRXkMD5zW6 iyOt4SpfFQfOgMo5Q/bU4XbRnF3syL9+T7ZsIy2yCkS0/yc2X3ftdhYFDFH+udZUbxqC 5B+KKyIVl8SL3wT/PsoQ0H4UOCU9U2hgRXI/AmEy9gWRXNM+CagbPQcDLscV7jfvVa49 5h6w== 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; bh=UwrMVVEeNJRl/O4vH5oB/Pb+wHeIg9wsvAvBZ7PUj/4=; b=rzgid+LEToC3LfY/uJz5Vpre0cGa67vSEDas7nvbX+Kt3nGd2DlvVzpVfiKpJ/fHr/ CKqNL2xlnhonTzDu9Jq3VNAGYWdZH7lfil/hSAQyksn/vnhTipU4Znz/6s8WslrVlCV1 8f0SmWAAFqzXo1SGCPMmgFEvrjNkvA2meBBCroSuwf1RuY2FOUV9yoooaALkb9SxgMO7 ca9aTu9ayykVcLMIia3R7aRdu01U8+wU0khgIB2sDRiMtBEiCoxKgrCzxilWPu/+ZVbn XjivK5+XonB/qIl9j329JrirgSmvLAepa/ZeDwbgxmRBRbvuAwjyBs4dTjffmM3MjXvu iXJA== ARC-Authentication-Results: i=1; mx.google.com; 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 u9si7343928jat.83.2021.05.21.13.13.55; Fri, 21 May 2021 13:14:08 -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; 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 S233899AbhEULPR (ORCPT + 99 others); Fri, 21 May 2021 07:15:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:56356 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhEULPQ (ORCPT ); Fri, 21 May 2021 07:15:16 -0400 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 09F4FABB1; Fri, 21 May 2021 11:13:52 +0000 (UTC) Subject: Re: [PATCH v6] mm: slub: move sysfs slab alloc/free interfaces to debugfs 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, glittao@gmail.com, greg@kroah.com Cc: vinmenon@codeaurora.org References: <1621341949-26762-1-git-send-email-faiyazm@codeaurora.org> From: Vlastimil Babka Message-ID: Date: Fri, 21 May 2021 13:13:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1621341949-26762-1-git-send-email-faiyazm@codeaurora.org> 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 5/18/21 2:45 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. > > Rename the alloc_calls/free_calls to alloc_traces/free_traces, > to be inline with what it does. > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Faiyaz Mohammed > @@ -5817,6 +5769,249 @@ static int __init slab_sysfs_init(void) > __initcall(slab_sysfs_init); > #endif /* CONFIG_SYSFS */ > > +#if defined(CONFIG_SLUB_DEBUG) && defined(CONFIG_DEBUG_FS) > +static int debugfs_slab_alias(struct kmem_cache *s, const char *name) > +{ > + struct saved_alias *al; > + struct dentry *slab_cache_dir; > + > + if (slab_state == FULL) { > + /* > + * If we have a leftover link then remove it. > + */ > + slab_cache_dir = debugfs_lookup(s->name, slab_debugfs_root); > + debugfs_remove(slab_cache_dir); > + debugfs_create_symlink(name, slab_debugfs_root, NULL); v6 got stuck on boot for me, unlike v5, seems like here you should return 0? That helped > + } > + > + al = kmalloc(sizeof(struct saved_alias), GFP_KERNEL); > + if (!al) > + return -ENOMEM; > + > + al->s = s; > + al->name = name; > + al->next = alias_list; > + alias_list = al; > + return 0; > +} > +