Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp243197iob; Mon, 2 May 2022 18:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh0QSau/jV/xlSXAqgji+sPJJ0jyMVjsRMSyTcqZOqD4Go/6XXz6jfNTNzWOwEJx657P6F X-Received: by 2002:a17:90a:9914:b0:1db:d10f:1fcf with SMTP id b20-20020a17090a991400b001dbd10f1fcfmr2062871pjp.241.1651540678375; Mon, 02 May 2022 18:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651540678; cv=none; d=google.com; s=arc-20160816; b=jExn4YbKq+QNUhI7jTdWfqi7ogSj56c75kZd9dijfiNoH3Ng13EcJ7NcEDPTNw4+3y Hn/okzGWf7iPYjQ3OwbkN41gX9KA8LCdoeJuE5IXIiYZdSxWvkEBevukVZT9jGuVm1O8 l/KeVSnBsZFkxwbFAZ3hdByIYbAD9ZM8Oz+yNmBLWjQu9vk6nlu5uO0X0ZmYfnmEInZC do3LKDWfitxB1We95PAidcANt8bNxPNhnAafuLXuvZKzpdYEYNk4JjME7mEb3kvZey0B SHhowTZYWAolzrW9Fha0eFkMRWcwSnZ9CUww1YntCRWwNN46mlvyBTm7P5xyygeYuMyF +ZSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=J9TwSQbH6wqCBuThjrzdtxN2LipJZ90ZPvowEWzdp+g=; b=hqYuuku2ReSKeGl3tR5HPbydZtpamTBWSsit+AbuN/SLY0DUyP5snmGtNij2hA/b/m m2pIRcCKc31FegjNwWIbMsixRMKiM3sh/zcnsReIrCIUxDk860thkyMg43WL1tEkwG+8 UjxFdjz6QeSiGo9lBRzQ8muxSkfSu0Y15s6cH4+AcGomNfYAZaKf9EdHVFZxWEvfX8jf bPgrC4ztSmauWoBwThwqq0M2oIbQKsRCYoB3U/DW0d2mLDjPOl9CHH+acfeShyeWZZvU q/haXBGnRjyCGJczinibI8+EQ4pdOJvU1ZEZxXXcV26oDBegh4OkOWgGZ00CM0ep2Nij Lz4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=L2e1yaoY; dkim=neutral (no key) header.i=@suse.cz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x2-20020a654142000000b0039d8ab23adesi16736418pgp.580.2022.05.02.18.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:17:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=L2e1yaoY; dkim=neutral (no key) header.i=@suse.cz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 26E04522FB; Mon, 2 May 2022 17:57:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377160AbiD2OK6 (ORCPT + 99 others); Fri, 29 Apr 2022 10:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377081AbiD2OKZ (ORCPT ); Fri, 29 Apr 2022 10:10:25 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10988A7CF for ; Fri, 29 Apr 2022 07:05:16 -0700 (PDT) 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-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?