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 7610AC433F5 for ; Tue, 22 Feb 2022 21:00:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D92E8D0002; Tue, 22 Feb 2022 16:00:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 988308D0001; Tue, 22 Feb 2022 16:00:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 850188D0002; Tue, 22 Feb 2022 16:00:22 -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 7275A8D0001 for ; Tue, 22 Feb 2022 16:00:22 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 342F222057 for ; Tue, 22 Feb 2022 21:00:22 +0000 (UTC) X-FDA: 79171633884.06.2F9E71F Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf07.hostedemail.com (Postfix) with ESMTP id 485A34000A for ; Tue, 22 Feb 2022 21:00: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=1645563599; 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=rR9mJGhOKtn9kf20PB2wxwjEh4TCBENUYk0Y5w7wjTA=; b=lfgskaUiO7607ToiOMsHXV2m7InKBJUklkHgUcLA9zeWdsXMeuJPQ01sC58ePzLuEKFCiJ JZomoKBMAe9O7yN+3E5YrDOsOErGNo6m6+odJFuXKspIO4GQNFsrg0WvTiAtHKnHYVMSoS Y1JjyAPE6uIDEu8Wsh4IV8ERZDe7Yuo= 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: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> Date: Tue, 22 Feb 2022 12:59:55 -0800 Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Vlastimil Babka , Linux MM , Andrew Morton , kernel@openvz.org Message-Id: <2CB29870-0D00-4518-A720-5B0A4B82CAF7@linux.dev> References: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> To: Vasily Averin X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=lfgskaUi; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf07.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 485A34000A X-Stat-Signature: hjrmaccmsf19njgs6axpoysipcgoep87 X-HE-Tag: 1645563601-774631 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 4:10 AM, Vasily Averin wrote: >=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 slab o= bjects. >>> it assumes that all objects stored in cpu caches are always 100% in use.= >=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? man= slabinfo ?) > Also I would like to know is it some (fast) way to get real numbers in use= rspace ? > crash is too fat for this task. > Do you know perhaps some other userspace utility or may be systemtap/drgn s= cript? Btw, implementing fast slab counters independent from the sl*b implementatio= n and the physical layout of data might be an interesting idea. Currently /proc/slabinfo is often confusing because of the slab merging. It=E2= =80=99s particularly true when someone tries to compare memory usage on two d= ifferent kernel versions, for example: the set of slab caches might look ver= y different depending on subtle changes in object sizes and the caches mergi= ng outcome.