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 AA042C433EF for ; Wed, 23 Feb 2022 17:31:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D20828D0030; Wed, 23 Feb 2022 12:31:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA8218D0011; Wed, 23 Feb 2022 12:31:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B21828D0030; Wed, 23 Feb 2022 12:31:15 -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 8A42C8D0011 for ; Wed, 23 Feb 2022 12:31:15 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 393AD233CC for ; Wed, 23 Feb 2022 17:31:15 +0000 (UTC) X-FDA: 79174735710.04.D10ADA5 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf24.hostedemail.com (Postfix) with ESMTP id 3972218000F for ; Wed, 23 Feb 2022 17:31:14 +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 CEE7F1F448; Wed, 23 Feb 2022 17:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645637472; 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=S21CfbvpEtwHt8vbET3xN5FI6PMizegaqfe1BKVQwyE=; b=ao5k7kqN8r7WqrceueZ5dFfI5BDP3p9pCXObaykWPOsqKrKlPpnLjPHTwAkpzYUubTAuOd pJ0UeNKUbh8yEmLFh/WfEY0kzR3fPLcpFR+v/3KFzSjuqPL24CvpnEYHrk9z1hrXLMIC+O V2wz0GMRduGRPGOmp+YBO9/kLihfITM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645637472; 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=S21CfbvpEtwHt8vbET3xN5FI6PMizegaqfe1BKVQwyE=; b=IjGuJ328LywQXiS/iemPB1EL5VnGqtct4W/fI3GB+ZJJ4Vv6tbZfGxnGjBqza8FOXXxCK2 Y0K+BtmJrFn8dDBw== 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 A57FA13DA3; Wed, 23 Feb 2022 17:31:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OfqVJ2BvFmIWJAAAMHmgww (envelope-from ); Wed, 23 Feb 2022 17:31:12 +0000 Message-ID: <324372c6-1d9e-cdc9-b5b3-157746da8445@suse.cz> Date: Wed, 23 Feb 2022 18:31:12 +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: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Roman Gushchin , Vasily Averin , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , Linux MM , Andrew Morton , kernel@openvz.org References: <5f318050-cf2a-2e3b-b980-f449d5c54f7c@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ao5k7kqN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=IjGuJ328; dmarc=none; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3972218000F X-Stat-Signature: zuros84wjn3goze3m3tiixrbfj54xjou X-HE-Tag: 1645637474-425876 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/23/22 04:45, Hyeonggon Yoo wrote: > On Wed, Feb 23, 2022 at 01:32:36AM +0100, Vlastimil Babka wrote: >> Hm it would be easier just to disable merging when the precise counters are >> enabled. Assume it would be a config option (possibly boot-time option with >> static keys) anyway so those who don't need them can avoid the overhead. > > Is it possible to accurately account objects in SLUB? I think it's not > easy because a CPU can free objects to remote cpu's partial slabs using > cmpxchg_double()... AFAIU Roman's idea would be that each alloc/free would simply inc/dec an object counter that's disconnected from physical handling of particular sl*b implementation. It would provide exact count of objects from the perspective of slab users. I assume for reduced overhead the counters would be implemented in a percpu fashion as e.g. vmstats. Slabinfo gathering would thus have to e.g. sum up those percpu counters. > Or would you count them by iterating all of cpu partial slabs and node > partial slabs? (Something like drgn script or new procfs file?) >