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 BCC33C433F5 for ; Tue, 22 Feb 2022 16:47:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45D328D0002; Tue, 22 Feb 2022 11:47:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40B808D0001; Tue, 22 Feb 2022 11:47:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 321A68D0002; Tue, 22 Feb 2022 11:47:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 2404D8D0001 for ; Tue, 22 Feb 2022 11:47:50 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D6B8821379 for ; Tue, 22 Feb 2022 16:47:49 +0000 (UTC) X-FDA: 79170997458.02.25D054E Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf27.hostedemail.com (Postfix) with ESMTP id 448934000A for ; Tue, 22 Feb 2022 16:47:49 +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=1645548467; 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=fxcpzXkcvTwjWWFV19vdOMlypb1Czk+z3T151PrkvlU=; b=euCeyD5Em8fbHMOFy4Y2tabUY4e7haqizJk4hxAgAorongC54pO0ReeFTuebyApfenK53P vMY/P70RbwSxxF3pzXmw1+v2cqx5kFvSSSwKDYSrt4CmV/4DYTuxKVUAjHp12x+AXdZKMs joKkjBgtA7yDg3o1g5jmT+LV1STRf3E= 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 08:47:44 -0800 Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Vlastimil Babka , Linux MM , Andrew Morton , kernel@openvz.org Message-Id: <39D8F5E1-85E1-4B43-9FCB-379ACCEC75F4@linux.dev> References: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> To: Vasily Averin X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 448934000A X-Stat-Signature: feobn85cikm9ju6hmafeha8z8afcbqzw Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=euCeyD5E; spf=pass (imf27.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-HE-Tag: 1645548469-614621 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 ?) Man page is the best place, IMO. > 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? You can hack something based on memcg_slabinfo.py for this purpose. It alrea= dy contains the code to iterate over all slab pages, you just need to gather= necessary stats. Of course the data will be racy, but should be good enough for practical pur= poses. I used something like this when was looking for the real slab utilization nu= mbers when started reworking the slab memory accounting. > I'm preparing new set of memcg accounting patches, with reparired tools/cg= roup/memcg_slapinfo.py > I can get numbers of accounted resources, but I need to understand how may= resources was NOT > accounted to memcg but allocated on host. I expected get these numbers fro= m host's slabinfo but > it does not show correct numbers. I=E2=80=99m really curious what these patches are. Are you looking to enable= accounting for more slab caches? Thanks!=