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 B4D40C433EF for ; Fri, 4 Mar 2022 16:29:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16FEC8D0002; Fri, 4 Mar 2022 11:29:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F87E8D0001; Fri, 4 Mar 2022 11:29:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDAEA8D0002; Fri, 4 Mar 2022 11:29:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id DB4F88D0001 for ; Fri, 4 Mar 2022 11:29:33 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9759125A5C for ; Fri, 4 Mar 2022 16:29:33 +0000 (UTC) X-FDA: 79207239426.05.1453082 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf10.hostedemail.com (Postfix) with ESMTP id D1234C0004 for ; Fri, 4 Mar 2022 16:29:32 +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 73FED1F386; Fri, 4 Mar 2022 16:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646411371; 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=wz1PrSv65AWWeoVdGyCfTi8C2E/olxQlqRDIETZ7ZX8=; b=YirO5B1rN6bOOePJSkAi/1Zi4LchYvjLdNDPXd7MR2Vb+GkgUgc4zZSmA/Zfo4SFofv/GE DrUxCQDqS9uQaOIiqbTrjGyhUTNDO5ASS3e9m/SrLV2zt1xoxn+0VKNQ0/mdAS5reM/+5B yU+yfGLp0kdUJnN9os4BxVngbHzv8pQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646411371; 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=wz1PrSv65AWWeoVdGyCfTi8C2E/olxQlqRDIETZ7ZX8=; b=hbzLSrvYe3cJAyKyMmi6Dzpwzwx2b6gYeizrecMPXeHPP30kkMcRirB3C9w7T9nQV2xoeX R6XZP149S+3TujDw== 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 563E613CE6; Fri, 4 Mar 2022 16:29:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /sVcFGs+ImK2TAAAMHmgww (envelope-from ); Fri, 04 Mar 2022 16:29:31 +0000 Message-ID: <4fa4263d-4846-5d22-4c34-ac5a38d08b7e@suse.cz> Date: Fri, 4 Mar 2022 17:29:31 +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: Vasily Averin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Christoph Lameter , Roman Gushchin Cc: Linux MM , Andrew Morton , kernel@openvz.org References: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> From: Vlastimil Babka In-Reply-To: <2f063652-3f53-b0d9-d588-17a15c2d701a@virtuozzo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1234C0004 X-Stat-Signature: wkw5bnnj6idtzs75e6zzceqrtw5o389p Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=YirO5B1r; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hbzLSrvY; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646411372-901266 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 13:10, Vasily Averin wrote: > 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? Oh I realized you can get much closer to real numbers via doing echo 1 > /sys/kernel/slab//shrink and then reading slabinfo immediately Although it will be racy if the flushed slabs are immediately refilled by allocation activity, and the flush will affect performance. But maybe in some situations it's useful. > I'm preparing new set of memcg accounting patches, with reparired > tools/cgroup/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 from > host's slabinfo but > it does not show correct numbers. > > Thank you, >     Vasily Averin >