Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3833625iob; Mon, 2 May 2022 06:52:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylYtB04ZmIgSVObBE5YTt36YRheGGl81RL5n4Ss4mof1JTkAkeU61JJSPTOoDHD952aCcu X-Received: by 2002:a17:90b:3e83:b0:1d2:edd3:5639 with SMTP id rj3-20020a17090b3e8300b001d2edd35639mr18203055pjb.183.1651499523764; Mon, 02 May 2022 06:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651499523; cv=none; d=google.com; s=arc-20160816; b=yosu45dejgNf8VXDUln4d/Cmt0I5e9qp7SSh8X+RXWz8mle8XY1HaUQgDLY6437GcN 09gm1590FrurNc3t6g1ArXoKE26Ucuv6vT++vlEY1UGYrx68fWRbr6jUEIo1LW7mjzXr soX2dlBykZMhGWT5RkX42+E7Nc7HuiBHTCaBZgXssIGnwP3OZw+1gWQ2qenzAnDcA3Gf 2ocsT36W1PUR3cEyALPUULtK+8KVeQXPMNJRzib6JrWiv23V1dPyGc5g28QvD4J6jsHf APKbQedoVnJ69s05iirPVzTCCuSgH109n+L48fTtEZz2Pi9XrA9Bbb+dYDXBENj9vque /rwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3qyc93eVxjKciEghxxTNYojB9G3OXnPRX/JlJbaTsqE=; b=E35BkJ6iYBxPfGZXv4R528sFPCmULYDC1Y8kIOlf1ZpHJHmm6sJqpzRWEcof38/93v wncchEmPlXzwpFCNpjZeuXt/gZ66RozzID4o6xll7DAEsKn/dFCJ2c6EPXLKe2wlJVYO FJIcIGZqNC/+Vov0SXaThntG2ob5C/NWg81AzeQE9wJ2NeNqJ5rU5L2JqJn0jFvf4zZ5 rgN/QXZsl0Bk/3RXzdjhiL+oYA8Y14OnYbezFEGXkY5Ms1gaC0IfuU6AuqnCPci/l2BT /VSf/p77qIiXBMYKd595BnRcv/sYxbCQfsrKdflYNrZaD5V3O/xqwhw04pFEiJ1PhoUb 5cJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U+dQbv3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r136-20020a632b8e000000b003c14ba0d89asi13584696pgr.863.2022.05.02.06.51.46; Mon, 02 May 2022 06:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=U+dQbv3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242217AbiD3OKZ (ORCPT + 99 others); Sat, 30 Apr 2022 10:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbiD3OKX (ORCPT ); Sat, 30 Apr 2022 10:10:23 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 130A46622D for ; Sat, 30 Apr 2022 07:07:02 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id r83so8560568pgr.2 for ; Sat, 30 Apr 2022 07:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3qyc93eVxjKciEghxxTNYojB9G3OXnPRX/JlJbaTsqE=; b=U+dQbv3vRNOyjnDfUPoNdWsgzn5/IazTAZXYJ1oiWvw2MiyXcpukRMTSt6xUdU7Zd1 6IMOwSY3x2927gzcrZFoaW6nhQnSEVegvx+hj/7rsAu9t8Ncfv6naAvq2CcCtBy5fnnt Vp0qpCCzoxhFnCLQ6zaaaCZ/XG59yY4rk2fxx5FRWpGgvC/KUD+3NQMlwrZQuk5qCrYV vZWJ+hF+V6zNW2d117flQvCNVGBtqSwXnjYQQcyxxYEsj3sJhghswF7uMmu6eSQ8CbEk jZB1jkJNQagXXJvJTTq72odRA60rMqgUHzOdddtApJYSAmrUR4iHaWrOzqP0TpxlRJMa v1eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3qyc93eVxjKciEghxxTNYojB9G3OXnPRX/JlJbaTsqE=; b=nrREWCFPqR1HhI527FKARYml3/fCFVIHicFDPVxG1HPiqm3vHc4VjUWjJ3wYXXqZ/x LE4CEyYEtoXPRJaf7a8AdH+D0/HVvHAYb6LW3jLHLqBIWIw1XDxHBUIuBES9T4FBb26g kK6IfgcIO2+hZSmheUPRHXgdMbDmS56AwsZn1kfnRk2vM23GjnL5Dd+or//1IkMSuxIz hldVQmXiGZXJ2AKbyu/w3XZFe04ZPBL0aqLhR0pGpHNdMWiBrWWxK9jIsEXXPQCTJ+GC CwLBNd+6FL8YfzIfOgOyuEBB4KlRrpwxc/VwvKb1dn7no/697WjrkXxeD0KtCyXuXa4r BDwA== X-Gm-Message-State: AOAM5323P2YbZePObdFdK8TY+R4za52BZmyq9SuIZ8xInSVd5yyffYTh MBQXlI19zO8ieEKH3J42ezSyZgLMg0DIIsmYu7c= X-Received: by 2002:a05:6a00:b4d:b0:50d:7e9f:1ff0 with SMTP id p13-20020a056a000b4d00b0050d7e9f1ff0mr3836232pfo.80.1651327621495; Sat, 30 Apr 2022 07:07:01 -0700 (PDT) Received: from ip-172-31-27-201.ap-northeast-1.compute.internal (ec2-18-183-95-104.ap-northeast-1.compute.amazonaws.com. [18.183.95.104]) by smtp.gmail.com with ESMTPSA id y17-20020aa78051000000b0050dc76281b2sm1619127pfm.140.2022.04.30.07.06.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Apr 2022 07:07:00 -0700 (PDT) Date: Sat, 30 Apr 2022 14:06:55 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka 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 Subject: Re: [PATCH v2 14/23] mm/slab_common: print cache name in tracepoints Message-ID: <20220430140654.GB25819@ip-172-31-27-201.ap-northeast-1.compute.internal> References: <20220414085727.643099-1-42.hyeyoo@gmail.com> <20220414085727.643099-15-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Fri, Apr 29, 2022 at 04:05:14PM +0200, Vlastimil Babka wrote: > 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. Make sense. > 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). Those suggestions makes sense to me. kmalloc and kmem_cache_alloc are a bit different. > Not using a common tracepoint will prevent some later unifications/cleanup > (patch 21?), but hopefully not too much? In v2 unification of __kmalloc_node()/kfree() somewhat depends on unified tracepoint. I'll try to unify them with this approach in v3.