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 DFD53C433F5 for ; Sat, 30 Apr 2022 14:07:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CA366B0072; Sat, 30 Apr 2022 10:07:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 578B76B0073; Sat, 30 Apr 2022 10:07:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 440FA6B0074; Sat, 30 Apr 2022 10:07:03 -0400 (EDT) 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 32EB66B0072 for ; Sat, 30 Apr 2022 10:07:03 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB683288E2 for ; Sat, 30 Apr 2022 14:07:02 +0000 (UTC) X-FDA: 79413721884.09.DEFB183 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by imf04.hostedemail.com (Postfix) with ESMTP id EB5E340077 for ; Sat, 30 Apr 2022 14:06:56 +0000 (UTC) Received: by mail-pf1-f169.google.com with SMTP id j6so9084744pfe.13 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=xb/gyRmaYZ6HU4OejO9v7i8Tq4ajB0c/tY5+NuHmGDJewsY/329sfqK7hpt7rIHqsB EvhMK4sgZsGRwyRzHolIt1kJQgThdGdFosT2H+y7gUMiqboeqlP73cuU1Y3mf5gc4pVO xfdGT0EJllVaArtoxQMF1vGxIsdBSrHeNxUqlQw1Iyj2fIcK1x5Ke/AVOGGxKyo1KDpt 8KNwmMr3YkQPqPeLcn85crirJSYX0AL6JXDEIJzQrWd2Lul3wbmntMA0DM3D1bigkosU y0q6d0Y7RlQwmAq2xZ/5BGUi6YT0gaVKf8IbyeZaD2VzLjTE0mtaVGp+lUsTMsL71aWq QYmg== X-Gm-Message-State: AOAM530Izrx3LW+ziUds1rmAA9PoJYB0Q+jarSQU5SE05yIfQcxPBHfj Nk9Ssr/bdMhpF/QDJVSEMxY= X-Google-Smtp-Source: ABdhPJyZ0IE9luX0BgG75JlBIYlhHQrEWVcw73ftjswKMSv09tEN7s8KAxRALXvinyLi1g2RqVpWfg== 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-Rspamd-Queue-Id: EB5E340077 X-Stat-Signature: 9a94ui818ez5wdb751i14o93ek1d1bf4 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=U+dQbv3v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.169 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1651327616-995344 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 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.