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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 72654C47089 for ; Wed, 26 May 2021 14:26:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F34C461360 for ; Wed, 26 May 2021 14:26:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F34C461360 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 47C7B6B0036; Wed, 26 May 2021 10:26:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42BD56B006E; Wed, 26 May 2021 10:26:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A5D26B0070; Wed, 26 May 2021 10:26:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0025.hostedemail.com [216.40.44.25]) by kanga.kvack.org (Postfix) with ESMTP id ED46A6B0036 for ; Wed, 26 May 2021 10:26:50 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 86464181AF5C4 for ; Wed, 26 May 2021 14:26:50 +0000 (UTC) X-FDA: 78183608580.09.B42D0E7 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf17.hostedemail.com (Postfix) with ESMTP id 4725140B8CF5 for ; Wed, 26 May 2021 14:26:45 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) by smtp-out1.suse.de (Postfix) with ESMTP id B4A92218C1; Wed, 26 May 2021 14:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622039208; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xlBw810CtHPmcgP8WpT8r3LgMwxxwOgbO4Q73mta+GY=; b=b56LQQ6YjOdy9NwVSTnpNM0rdhqf3tK35hqG8gNpc1BntrjjL1Jwu6ZVvoOhig52ozHOV2 lwZnw3aIM0hwHv2GeT/7KHWOVwk2ZAydBl5ubxOXL8TlL9QNPPc0BaW3nVroA6lljLM6z+ ebKbimPA6sjyKI8hIm82yZrHwSKRw4c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622039208; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xlBw810CtHPmcgP8WpT8r3LgMwxxwOgbO4Q73mta+GY=; b=mIX+pg9bxDNrLH2xfB5GjnrV1tbIubqOeT2K3bvyXd6Sgt1i1/pqNEpRLahoCS1xgQhKE6 y/yxz8Yr+NbbSRCQ== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id 8F19F11A98; Wed, 26 May 2021 14:26:48 +0000 (UTC) Subject: Re: [RFC 3/3] mm/slub: add all_objects implementation in debugfs To: glittao@gmail.com, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, faiyazm@codeaurora.org References: <20210521121127.24653-1-glittao@gmail.com> <20210521121127.24653-3-glittao@gmail.com> From: Vlastimil Babka Message-ID: <48b461c6-0221-5f8c-fb53-08a1f299b048@suse.cz> Date: Wed, 26 May 2021 16:26:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210521121127.24653-3-glittao@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4725140B8CF5 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=b56LQQ6Y; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=mIX+pg9b; spf=pass (imf17.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam04 X-Stat-Signature: y938da3rjhhxmecfhrtm7rkarqkmbojp X-HE-Tag: 1622039205-419745 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 5/21/21 2:11 PM, glittao@gmail.com wrote: > From: Oliver Glitta > > Add all_objects implementation to debugfs to print information > about all objects in slub cache. An example listing of 1-2 objects would be useful in the changelog. Also can you describe what are the guarantees (or limitations) of observing really all objects if the cache is modified by concurrent allocation and free operations? ... > +static void *debugfs_all_objects_start(struct seq_file *m, loff_t *ppos) > +{ > + struct slab_debug_private *priv = m->private; > + struct kmem_cache *s = priv->inode->i_private; > + struct page *page; > + > + priv->map = kmalloc(BITS_TO_LONGS(MAX_OBJS_PER_PAGE), GFP_KERNEL); We can use bitmap_alloc/bitmap_free wrappers and allocate according to objects per page in the actual kmem_cache, not the theoretical maximum, see: https://lore.kernel.org/linux-mm/20210524233946.20352-2-vbabka@suse.cz/