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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFFEFC433EF for ; Tue, 22 Feb 2022 23:08:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B2D18D0002; Tue, 22 Feb 2022 18:08:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43B858D0001; Tue, 22 Feb 2022 18:08:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B5878D0002; Tue, 22 Feb 2022 18:08:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 14C9A8D0001 for ; Tue, 22 Feb 2022 18:08:27 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id D5CD21205F3 for ; Tue, 22 Feb 2022 23:08:26 +0000 (UTC) X-FDA: 79171956612.03.29160A5 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf22.hostedemail.com (Postfix) with ESMTP id 49FD5C000F for ; Tue, 22 Feb 2022 23:08:26 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 787881F3A3; Tue, 22 Feb 2022 23:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645571304; 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=l0xnxd6eOZwcNtw/5m6N28ihJ3JI8vUGidTugWWFG3M=; b=l1ByDsf65Ab8Y5JQyE2y+qSf4yvpiSke8ymN4UPrkNkqV0CeRTU5MS43NXm1eWjS3O9abl w8n8JUgHdn3Ns0Q8tyUEQd+vHTiBoABWAkHEq/CabkukuePdEfYvjYbERpKhE9Dc81wyy8 xhTaXxjrxD16OzxU5fQVLrqC5Ez9zRk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645571304; 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=l0xnxd6eOZwcNtw/5m6N28ihJ3JI8vUGidTugWWFG3M=; b=0QJkj1mSM4BqoyXWhBGUL7Hu1PLq6XMTDXhiq3ZU2DYe0CWuwgs5gh0S0OtuF0xq5C6MLx 6kkB7rtB3DmubUBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4869913C16; Tue, 22 Feb 2022 23:08:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kb5CEOhsFWJfXgAAMHmgww (envelope-from ); Tue, 22 Feb 2022 23:08:24 +0000 Message-ID: <5f318050-cf2a-2e3b-b980-f449d5c54f7c@suse.cz> Date: Wed, 23 Feb 2022 00:08:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: slabinfo shows incorrect active_objs ??? Content-Language: en-US To: Roman Gushchin , Vasily Averin , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Linux MM , Andrew Morton , kernel@openvz.org References: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> <2CB29870-0D00-4518-A720-5B0A4B82CAF7@linux.dev> From: Vlastimil Babka In-Reply-To: <2CB29870-0D00-4518-A720-5B0A4B82CAF7@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: tm16tiicof8dt4o1nuo6drdcesj44rjo X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=l1ByDsf6; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=0QJkj1mS; spf=pass (imf22.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 49FD5C000F X-HE-Tag: 1645571306-75527 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 2/22/22 21:59, Roman Gushchin wrote: > >> On Feb 22, 2022, at 4:10 AM, Vasily Averin wrote: BTW please To/Cc directly all slab maintainers on future slab related threads (added now). >> On 22.02.2022 13:23, Hyeonggon Yoo wrote: >>>> On Tue, Feb 22, 2022 at 12:22:02PM +0300, Vasily Averin wrote: >>>> Dear all, >>>> >>>> I've found that /proc/slabinfo shows inadequate numbers of in-use slab objects. >>>> it assumes that all objects stored in cpu caches are always 100% in use. >> >>>> Is it a bug or perhaps a well-known feature that I missed? >>> This is not a bug.. >> >> Thank you for explanation, >> I think it would be useful to document this somewhere. (Documnetation? man slabinfo ?) >> Also I would like to know is it some (fast) way to get real numbers in userspace ? >> crash is too fat for this task. >> Do you know perhaps some other userspace utility or may be systemtap/drgn script? > > Btw, implementing fast slab counters independent from the sl*b implementation and the physical layout of data might be an interesting idea. Interesting idea, but merging will be an issue if we ever manage to officially allow kfree() on object allocated by kmem_cache_alloc() - which is now blocked by SLOB (there was a recent thread that stalled). > Currently /proc/slabinfo is often confusing because of the slab merging. It’s particularly true when someone tries to compare memory usage on two different kernel versions, for example: the set of slab caches might look very different depending on subtle changes in object sizes and the caches merging outcome. >