Message ID | 20221017160233.16582-7-urezki@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1528813wrs; Mon, 17 Oct 2022 09:08:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4giypRQQdBfN/qZQ0AGRMGBMT5l1njK3RYuQE1dTlg1c8KcgfvQ0NLeQIFmDNebpRzSotl X-Received: by 2002:a17:907:2c78:b0:78d:eacd:1060 with SMTP id ib24-20020a1709072c7800b0078deacd1060mr9031198ejc.244.1666022922398; Mon, 17 Oct 2022 09:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666022922; cv=none; d=google.com; s=arc-20160816; b=ScJD+3NmTlFjv3HW5STthWxqqS/nmxo2LKde6v9M/g93/u3FbvCIzBJC02uwE22m+B uC85FQEkHbhs1iSdC+/rY1zwZuh1IjSQyC9oYbbLtzfEMPuLki5jefg6iOwgH7uzt4cr nCMO5qyxwk2otq7K08o7pXWS4oq19o8JE0yxSaWtaQkRr/3V7wb9XIMElQCHviLWGFHM zfY7wzRrvvnu+5sIAckoEWcma6YRnGtBOVc/4j3n0ffYUbr2drR/rRRaHmTOZPKsp1iA FDiiNXU08RFP0yUfFboib9VsXlc4vsOtcRvytitPK7NUySkfqFHNneY5kpw0Dn136j5X b+Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=rUc8JOlpbpGxS8ha9qmtGKmdAw/vLoj5583m3weLttuHq7YgAS/EcrMeYn8kiuVmOC NohlAwsGS5uGbrR7t5jBsYorYrpPUt6ri030PP/eefLWdBiviZaLClaQNIjVnVpN3UzW 5I9IjVqH6sf6IX+YNaTbq9L4UypAEiOsY4XvdlO8aAFTZVh53/rZV4cH8wS4nN+beuif vK+6an1TcM9NbIhtLMhUzDqHz7WsUg/GCB6bEoNqZ5j1UhakRT44a5y6JLt0IesIox8D TjVNt9zSmaAq1yLYDqfBsZx2wdikL0E9zRKCwFwYmcAl/L84JYGROKosM5DtaT5dqET8 mAvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Rfae/Y+4"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg16-20020a170907971000b0078def5c29e6si10728799ejc.531.2022.10.17.09.08.16; Mon, 17 Oct 2022 09:08:42 -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="Rfae/Y+4"; 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 S231255AbiJQQDC (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Mon, 17 Oct 2022 12:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbiJQQCr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Oct 2022 12:02:47 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0735A6DF8E for <linux-kernel@vger.kernel.org>; Mon, 17 Oct 2022 09:02:45 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id bj12so25923598ejb.13 for <linux-kernel@vger.kernel.org>; Mon, 17 Oct 2022 09:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=Rfae/Y+4yaGIP0vcpaZVNUfII+7m7g52LOf1BBwmovC33F4FdDhsJTYyIWL6AuKQyJ 00E7hdNbT9AJARRPFsDe+QTTbCVOvP+tYMJdn3lM6XO5CgyjpiptP6Q89gE+W1m+COwH HIeCPuYctOpQLqLjeW8NBHyioUVGGZIfXWGSFqtzWlYBCk3fQzcUr7twHFDxB6r6BW5L KFSwG/f1vRCNHovUODXMUVMhzSQ+3NWuvcbOzn46gaRHV7UEPuNjXWgRV3pLSNYQtIoe cya/NQMrFKU+F/PM631Jf2/A1+xMxqBwxO0MeJ6+eWPO8W3Tq1TO0XHKXup/VIpqLgfW nVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=ZyLSrGnWQH7+n/Lu33Sl3aHk2p4WONg5+rGq4dezU8FwwClkPlddJtxBMNSH/blMmd 3As5R8GxYVSj1ISxDHKmfX8AREr0Y9cQc+iY03/NQgCjtnVEhocKMuqoHzN7K5LXrWld OalRqohW+KoipH+i7CI/6IOl0mUa9Xp9wm+RDAqovtPBj65UJfpxtUxAC0Rr19ZFmKZI U5C6yDhGG37cKnQD4P//vrg+iIjqGoKXRA7wL4p45QXHoJQNabwfWBwQ6qi2vg6q+uLV tkgLGF4yMshx69+bqhGgdo5dapzaKX1FN02n9diNSvg89Z3OiSGwKHfTA80ZJtyxz6qs 5KCg== X-Gm-Message-State: ACrzQf2K0j48E47NEtAjcuOo6Q/1k8SpQSqcEnNFk98uLO8V10mg5buO E1q3Rpr6D19xBxDu9ZwTJGo= X-Received: by 2002:a17:906:7944:b0:73c:838:ac3d with SMTP id l4-20020a170906794400b0073c0838ac3dmr9166590ejo.242.1666022563310; Mon, 17 Oct 2022 09:02:43 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id g16-20020a170906539000b0073d5948855asm6389629ejo.1.2022.10.17.09.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:42 -0700 (PDT) From: "Uladzislau Rezki (Sony)" <urezki@gmail.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>, Christoph Hellwig <hch@infradead.org>, Matthew Wilcox <willy@infradead.org>, Nicholas Piggin <npiggin@gmail.com>, Uladzislau Rezki <urezki@gmail.com>, Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>, Steven Rostedt <rostedt@goodmis.org> Subject: [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event Date: Mon, 17 Oct 2022 18:02:30 +0200 Message-Id: <20221017160233.16582-7-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221017160233.16582-1-urezki@gmail.com> References: <20221017160233.16582-1-urezki@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746951651984486893?= X-GMAIL-MSGID: =?utf-8?q?1746951651984486893?= |
Series |
Add basic trace events for vmap/vmalloc
|
|
Commit Message
Uladzislau Rezki
Oct. 17, 2022, 4:02 p.m. UTC
This is for debug purpose and is called when an allocation
attempt occurs. This event gives some information about:
- a start address of allocated area;
- a size that is requested;
- an align that is required;
- vstart/vend restriction;
- if an allocation fails.
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
mm/vmalloc.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hi Uladzislau,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.1-rc1 next-20221017]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20221017160233.16582-7-urezki%40gmail.com
patch subject: [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event
config: um-i386_defconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/fbc853c689b29d3bb9fe250b2653fd2dd8046fc7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544
git checkout fbc853c689b29d3bb9fe250b2653fd2dd8046fc7
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/trace/events/vmap.h:123,
from mm/vmalloc.c:47:
>> include/trace/define_trace.h:84:34: fatal error: trace/events/kernel_vmap.h: No such file or directory
84 | # define __TRACE_INCLUDE(system) <trace/events/system.h>
| ^
compilation terminated.
vim +84 include/trace/define_trace.h
a8d154b0091683 Steven Rostedt 2009-04-10 82
a8d154b0091683 Steven Rostedt 2009-04-10 83 #ifndef TRACE_INCLUDE_PATH
ad8d75fff811a6 Steven Rostedt 2009-04-14 @84 # define __TRACE_INCLUDE(system) <trace/events/system.h>
c2518c4366f087 Steven Rostedt 2009-04-23 85 # define UNDEF_TRACE_INCLUDE_PATH
a8d154b0091683 Steven Rostedt 2009-04-10 86 #else
a8d154b0091683 Steven Rostedt 2009-04-10 87 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
a8d154b0091683 Steven Rostedt 2009-04-10 88 #endif
a8d154b0091683 Steven Rostedt 2009-04-10 89
Hello, Steven. > > [auto build test ERROR on akpm-mm/mm-everything] > [also build test ERROR on linus/master v6.1-rc1 next-20221017] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > patch link: https://lore.kernel.org/r/20221017160233.16582-7-urezki%40gmail.com > patch subject: [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event > config: um-i386_defconfig > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > reproduce (this is a W=1 build): > # https://github.com/intel-lab-lkp/linux/commit/fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > git checkout fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > # save the config file > mkdir build_dir && cp config build_dir/.config > make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > > All errors (new ones prefixed by >>): > > In file included from include/trace/events/vmap.h:123, > from mm/vmalloc.c:47: > >> include/trace/define_trace.h:84:34: fatal error: trace/events/kernel_vmap.h: No such file or directory > 84 | # define __TRACE_INCLUDE(system) <trace/events/system.h> > | ^ > compilation terminated. > I can reproduce it. It seems it happens so far only on the ARCH=um case. For regular arm/x86 i do not see such build error. If i rename the TRACE_SYSTEM macro to something different then "vmap" it compiles fine. In case of: #define TRACE_SYSTEM vmap the prefix "kernel_" is added, thus the header name becomes as kernel_vmap.h Steven can you give some indications? Or any thoughts about it? Thank you in advance! -- Uladzislau Rezki
On Tue, 18 Oct 2022 18:17:55 +0200 Uladzislau Rezki <urezki@gmail.com> wrote: > Hello, Steven. > > > > > [auto build test ERROR on akpm-mm/mm-everything] > > [also build test ERROR on linus/master v6.1-rc1 next-20221017] > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > And when submitting patch, we suggest to use '--base' as documented in > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > > patch link: https://lore.kernel.org/r/20221017160233.16582-7-urezki%40gmail.com > > patch subject: [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event > > config: um-i386_defconfig > > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > > reproduce (this is a W=1 build): > > # https://github.com/intel-lab-lkp/linux/commit/fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > git fetch --no-tags linux-review Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > > git checkout fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash > > > > If you fix the issue, kindly add following tag where applicable > > | Reported-by: kernel test robot <lkp@intel.com> > > > > All errors (new ones prefixed by >>): > > > > In file included from include/trace/events/vmap.h:123, > > from mm/vmalloc.c:47: > > >> include/trace/define_trace.h:84:34: fatal error: trace/events/kernel_vmap.h: No such file or directory > > 84 | # define __TRACE_INCLUDE(system) <trace/events/system.h> > > | ^ > > compilation terminated. > > > I can reproduce it. It seems it happens so far only on the ARCH=um case. > For regular arm/x86 i do not see such build error. > > If i rename the TRACE_SYSTEM macro to something different then "vmap" > it compiles fine. In case of: > > #define TRACE_SYSTEM vmap > > the prefix "kernel_" is added, thus the header name becomes as kernel_vmap.h > > Steven can you give some indications? Or any thoughts about it? > > Thank you in advance! It comes from this: arch/um/Makefile:# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so arch/um/Makefile: $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ It defines "vmap" to "kernel_vmap" which will change the above TRACE_SYSTEM Define to: #define TRACE_SYSTEM kernel_vmap and that will confuse everything else. -- Steve > > -- > Uladzislau Rezki
On Tue, Oct 18, 2022 at 12:44:12PM -0400, Steven Rostedt wrote: > On Tue, 18 Oct 2022 18:17:55 +0200 > Uladzislau Rezki <urezki@gmail.com> wrote: > > > Hello, Steven. > > > > > > > > [auto build test ERROR on akpm-mm/mm-everything] > > > [also build test ERROR on linus/master v6.1-rc1 next-20221017] > > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > > And when submitting patch, we suggest to use '--base' as documented in > > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > > > url: https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > > > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > > > patch link: https://lore.kernel.org/r/20221017160233.16582-7-urezki%40gmail.com > > > patch subject: [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event > > > config: um-i386_defconfig > > > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > > > reproduce (this is a W=1 build): > > > # https://github.com/intel-lab-lkp/linux/commit/fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > > git fetch --no-tags linux-review Uladzislau-Rezki-Sony/Add-basic-trace-events-for-vmap-vmalloc/20221018-000544 > > > git checkout fbc853c689b29d3bb9fe250b2653fd2dd8046fc7 > > > # save the config file > > > mkdir build_dir && cp config build_dir/.config > > > make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash > > > > > > If you fix the issue, kindly add following tag where applicable > > > | Reported-by: kernel test robot <lkp@intel.com> > > > > > > All errors (new ones prefixed by >>): > > > > > > In file included from include/trace/events/vmap.h:123, > > > from mm/vmalloc.c:47: > > > >> include/trace/define_trace.h:84:34: fatal error: trace/events/kernel_vmap.h: No such file or directory > > > 84 | # define __TRACE_INCLUDE(system) <trace/events/system.h> > > > | ^ > > > compilation terminated. > > > > > I can reproduce it. It seems it happens so far only on the ARCH=um case. > > For regular arm/x86 i do not see such build error. > > > > If i rename the TRACE_SYSTEM macro to something different then "vmap" > > it compiles fine. In case of: > > > > #define TRACE_SYSTEM vmap > > > > the prefix "kernel_" is added, thus the header name becomes as kernel_vmap.h > > > > Steven can you give some indications? Or any thoughts about it? > > > > Thank you in advance! > > It comes from this: > > arch/um/Makefile:# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so > arch/um/Makefile: $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ > > > It defines "vmap" to "kernel_vmap" which will change the above > TRACE_SYSTEM Define to: > > #define TRACE_SYSTEM kernel_vmap > > and that will confuse everything else. > Hm... Right then it goes completely crazy. So there is only one option it is to rename the trace header defined by the TRACE_SYSTEM. Thank you for your help :) -- Uladzislau Rezki
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 83b54beb12fa..f4397817ccd7 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -43,6 +43,9 @@ #include <asm/tlbflush.h> #include <asm/shmparam.h> +#define CREATE_TRACE_POINTS +#include <trace/events/vmap.h> + #include "internal.h" #include "pgalloc-track.h" @@ -1621,6 +1624,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, size, align, vstart, vend); spin_unlock(&free_vmap_area_lock); + trace_alloc_vmap_area(addr, size, align, vstart, vend, addr == vend); + /* * If an allocation fails, the "vend" address is * returned. Therefore trigger the overflow path.