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 3008EC433EF for ; Fri, 29 Apr 2022 14:05:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 56B686B0072; Fri, 29 Apr 2022 10:05:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 51AAF6B0073; Fri, 29 Apr 2022 10:05:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BBA16B0074; Fri, 29 Apr 2022 10:05:18 -0400 (EDT) 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 2ABD26B0072 for ; Fri, 29 Apr 2022 10:05:18 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id C44C880705 for ; Fri, 29 Apr 2022 14:05:17 +0000 (UTC) X-FDA: 79410088674.24.C2E9A73 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf19.hostedemail.com (Postfix) with ESMTP id 588791A006C for ; Fri, 29 Apr 2022 14:05:12 +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 58F541F892; Fri, 29 Apr 2022 14:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1651241115; 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=J9TwSQbH6wqCBuThjrzdtxN2LipJZ90ZPvowEWzdp+g=; b=L2e1yaoYyEVDYzHX0UrQ3YFliIwmEyhjL5+/bnJJUo1VCQ29dnAPTuZyp2gP7iqwJu8qoy ZkRPsXqD8ERWszn7TBVHUh2ejwzSVD0k26xC78zxTgg524wF9z6y+UwLS7P8qrH4EvxGco VOZGlycfuhzYXCb4uHEkJ4b4j8eX1K4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1651241115; 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=J9TwSQbH6wqCBuThjrzdtxN2LipJZ90ZPvowEWzdp+g=; b=MyAYPB2YFXeOxlUJ9UumhIPtf7PoNkqoqfscD1y9rpG736YCz7DQMYtVSr2KmU9mTUGTJn qbIuVb77XWNgj9Dw== 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 0B62113AE0; Fri, 29 Apr 2022 14:05:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nhQiApvwa2IBDQAAMHmgww (envelope-from ); Fri, 29 Apr 2022 14:05:15 +0000 Message-ID: Date: Fri, 29 Apr 2022 16:05:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Marco Elver , Matthew WilCox , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220414085727.643099-1-42.hyeyoo@gmail.com> <20220414085727.643099-15-42.hyeyoo@gmail.com> From: Vlastimil Babka Subject: Re: [PATCH v2 14/23] mm/slab_common: print cache name in tracepoints In-Reply-To: <20220414085727.643099-15-42.hyeyoo@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 588791A006C X-Stat-Signature: k5cxk7ncpjoiiqaqwz5hrf3apttmrmfk Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=L2e1yaoY; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=MyAYPB2Y; spf=pass (imf19.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-HE-Tag: 1651241112-557629 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 4/14/22 10:57, Hyeonggon Yoo wrote: > Print cache name in tracepoints. If there is no corresponding cache > (kmalloc in SLOB or kmalloc_large_node), use KMALLOC_{,LARGE_}NAME > macro. > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Regarding tracepoints, I'm not sure it's a good idea to unify kmalloc and kmem_cache_alloc. I think the common use case is to trace kmalloc as there are many different callers, and then I'm not interested in kmem_cache_alloc callers much. What I would suggest instead is: - drop the _node versions, add node to normal versions - drop the kmem_alloc EVENT_CLASS, as kmalloc is different enough from kmem_cache_alloc (see next points), define separately as TRACE_EVENT(). - printing cache_name makes sense to add for kmem_cache_alloc (also allows filtering events) but not for kmalloc. - kmem_cache_alloc with name can then drop the bytes_req, bytes_alloc as they are fixed for given name (and can be read from slabinfo). Not using a common tracepoint will prevent some later unifications/cleanup (patch 21?), but hopefully not too much?