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 29B43C433EF for ; Wed, 23 Feb 2022 00:08:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 863918D0002; Tue, 22 Feb 2022 19:08:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 811108D0001; Tue, 22 Feb 2022 19:08:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D9DA8D0002; Tue, 22 Feb 2022 19:08:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 5C3BA8D0001 for ; Tue, 22 Feb 2022 19:08:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2686620B2D for ; Wed, 23 Feb 2022 00:08:02 +0000 (UTC) X-FDA: 79172106804.05.9099D0D Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf21.hostedemail.com (Postfix) with ESMTP id 6EDF31C0012 for ; Wed, 23 Feb 2022 00:08:01 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1645574879; h=from:from:reply-to:subject:subject: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=W2ax98nrtEp74wnnCMH1KrdBsFlhjq1ZwQHNM22Ry5E=; b=LzowaXWm/3fi/Je8S0hgDdx34zWh/t/NYs9ywP/XcSBwBgrpp4pH5Gf2la7n/ATtjgDNdW ENjmgh//gGtx5LxagAazeoMLTBDmHkmErtFtS/+3cuqgpt6i3FkBls2/RCrjjYoiPZl28n TuSv5rJobqBTPgi1v7qBJDxlUo1t3tk= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: slabinfo shows incorrect active_objs ??? X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin In-Reply-To: <5f318050-cf2a-2e3b-b980-f449d5c54f7c@suse.cz> Date: Tue, 22 Feb 2022 16:07:56 -0800 Cc: Vasily Averin , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Linux MM , Andrew Morton , kernel@openvz.org Message-Id: References: <5f318050-cf2a-2e3b-b980-f449d5c54f7c@suse.cz> To: Vlastimil Babka X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6EDF31C0012 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=LzowaXWm; spf=pass (imf21.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Stat-Signature: kojuunpu496ax8fjznspscz9aqtq3jjy X-HE-Tag: 1645574881-160421 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 Feb 22, 2022, at 3:08 PM, Vlastimil Babka wrote: >=20 > =EF=BB=BFOn 2/22/22 21:59, Roman Gushchin wrote: >>=20 >>> On Feb 22, 2022, at 4:10 AM, Vasily Averin wrote: >=20 > BTW please To/Cc directly all slab maintainers on future slab related > threads (added now). >=20 >>> =EF=BB=BFOn 22.02.2022 13:23, Hyeonggon Yoo wrote: >>>>>> On Tue, Feb 22, 2022 at 12:22:02PM +0300, Vasily Averin wrote: >>>>>> Dear all, >>>>>>=20 >>>>>> I've found that /proc/slabinfo shows inadequate numbers of in-use sla= b objects. >>>>>> it assumes that all objects stored in cpu caches are always 100% in u= se. >>>=20 >>>>> Is it a bug or perhaps a well-known feature that I missed? >>>> This is not a bug.. >>>=20 >>> Thank you for explanation, >>> I think it would be useful to document this somewhere. (Documnetation? m= an slabinfo ?) >>> Also I would like to know is it some (fast) way to get real numbers in u= serspace ? >>> crash is too fat for this task. >>> Do you know perhaps some other userspace utility or may be systemtap/drg= n script? >>=20 >> Btw, implementing fast slab counters independent from the sl*b implementa= tion and the physical layout of data might be an interesting idea. >=20 > 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). Well, we can store an id somewhere (like right behind the object). Depending= on the object size and padding it might even take not so much extra space. M= aybe not the feature everybody needs (so it can be turned off by default), b= ut something that can be really useful in some cases.=