From nobody Sun Feb 8 02:25:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 253E31D7E54; Tue, 3 Jun 2025 17:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; cv=none; b=ZcBEk8g08upxkPhvSOpOtTvgmf6eaJT9oAIPzziBns6kdylKCWiGJ0lTYIJ0mbF9Od8Jd1ZpS0urE0OnEmdYy2hvMw4WBdeBVs4jUF1FUJdS5gb92zaTj38UnlSwnlj6P3jypMUVxdneYC0FzsYumjIZ1G6DyAHB2iqFSIabUgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; c=relaxed/simple; bh=fiZC9m2o/8iWsIotLzKkDj8RsLh9fnr3AXBC611yQRQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Vw9g5N8iO+MnOchWAOCdt5tKX3JFbCP4ai9Us35Y4vti8tR+VLJ+pWfKy8vCQ5qi6omuhWfW3WlQJdl1Q2V6Og5adhRoVs9+Jl3AlYnc+HsrNRPyh+HnA5JsfESJvl9k8mnQkfzuGuoRhE8mKuH2pxAc+jmU3bgLg8g8UTduoCY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE8AAC4CEF1; Tue, 3 Jun 2025 17:11:13 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uMVBc-0000000E3zZ-2PqM; Tue, 03 Jun 2025 13:12:28 -0400 Message-ID: <20250603171228.423180093@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 03 Jun 2025 13:11:50 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , stable@vger.kernel.org, Ye Bin Subject: [for-linus][PATCH 1/5] ftrace: Fix UAF when lookup kallsym after ftrace disabled References: <20250603171149.582996770@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ye Bin The following issue happens with a buggy module: BUG: unable to handle page fault for address: ffffffffc05d0218 PGD 1bd66f067 P4D 1bd66f067 PUD 1bd671067 PMD 101808067 PTE 0 Oops: Oops: 0000 [#1] SMP KASAN PTI Tainted: [O]=3DOOT_MODULE, [E]=3DUNSIGNED_MODULE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS RIP: 0010:sized_strscpy+0x81/0x2f0 RSP: 0018:ffff88812d76fa08 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffffffc0601010 RCX: dffffc0000000000 RDX: 0000000000000038 RSI: dffffc0000000000 RDI: ffff88812608da2d RBP: 8080808080808080 R08: ffff88812608da2d R09: ffff88812608da68 R10: ffff88812608d82d R11: ffff88812608d810 R12: 0000000000000038 R13: ffff88812608da2d R14: ffffffffc05d0218 R15: fefefefefefefeff FS: 00007fef552de740(0000) GS:ffff8884251c7000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffc05d0218 CR3: 00000001146f0000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ftrace_mod_get_kallsym+0x1ac/0x590 update_iter_mod+0x239/0x5b0 s_next+0x5b/0xa0 seq_read_iter+0x8c9/0x1070 seq_read+0x249/0x3b0 proc_reg_read+0x1b0/0x280 vfs_read+0x17f/0x920 ksys_read+0xf3/0x1c0 do_syscall_64+0x5f/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e The above issue may happen as follows: (1) Add kprobe tracepoint; (2) insmod test.ko; (3) Module triggers ftrace disabled; (4) rmmod test.ko; (5) cat /proc/kallsyms; --> Will trigger UAF as test.ko already removed; ftrace_mod_get_kallsym() ... strscpy(module_name, mod_map->mod->name, MODULE_NAME_LEN); ... The problem is when a module triggers an issue with ftrace and sets ftrace_disable. The ftrace_disable is set when an anomaly is discovered and to prevent any more damage, ftrace stops all text modification. The issue that happened was that the ftrace_disable stops more than just the text modification. When a module is loaded, its init functions can also be traced. Because kallsyms deletes the init functions after a module has loaded, ftrace saves them when the module is loaded and function tracing is enabled. This allows the output of the function trace to show the init function names instead of just their raw memory addresses. When a module is removed, ftrace_release_mod() is called, and if ftrace_disable is set, it just returns without doing anything more. The problem here is that it leaves the mod_list still around and if kallsyms is called, it will call into this code and access the module memory that has already been freed as it will return: strscpy(module_name, mod_map->mod->name, MODULE_NAME_LEN); Where the "mod" no longer exists and triggers a UAF bug. Link: https://lore.kernel.org/all/20250523135452.626d8dcd@gandalf.local.hom= e/ Cc: stable@vger.kernel.org Fixes: aba4b5c22cba ("ftrace: Save module init functions kallsyms symbols f= or tracing") Link: https://lore.kernel.org/20250529111955.2349189-2-yebin@huaweicloud.com Signed-off-by: Ye Bin Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1af952cba48d..84fd2f8263fa 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -7438,9 +7438,10 @@ void ftrace_release_mod(struct module *mod) =20 mutex_lock(&ftrace_lock); =20 - if (ftrace_disabled) - goto out_unlock; - + /* + * To avoid the UAF problem after the module is unloaded, the + * 'mod_map' resource needs to be released unconditionally. + */ list_for_each_entry_safe(mod_map, n, &ftrace_mod_maps, list) { if (mod_map->mod =3D=3D mod) { list_del_rcu(&mod_map->list); @@ -7449,6 +7450,9 @@ void ftrace_release_mod(struct module *mod) } } =20 + if (ftrace_disabled) + goto out_unlock; + /* * Each module has its own ftrace_pages, remove * them from the list. --=20 2.47.2 From nobody Sun Feb 8 02:25:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CDAC1DE2A0 for ; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; cv=none; b=qL+8Wcbyb27JlHdjwQQNGd/d0cTJlOajUtpwk1U0VWVx22wAdUk9KkVN9Y9t8qBccsKNRP36qbNsLzDHg/CwYF434jADk3FrLs+yoi00apL/SQutdBx3sPnj22MTGkE6PFZKvsV/4YRPD3ALpKUYd3UiiUW8RVieAzGD9v7y96Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; c=relaxed/simple; bh=aZhK6wG2PGLiBcUue9u+wu3jgnZx7VeVgIvnyB4Vi+g=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=mQOh/ZXXuCVKpU+bAJi/Dmh85gJd6bWbUFTQK+qj6y197+rpvgJnXqkY1kHI+VhE9scHcTHmdDtmhkvPY70el6YekR3AxoMptN7xPaeCXh7f7FgFxfqc97WpAxpuq1IwIvXKE4tJFghRAHlUiAlJJdQ+9lH47fBd6q3vZETKack= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB7B9C4AF09; Tue, 3 Jun 2025 17:11:13 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uMVBc-0000000E403-36q6; Tue, 03 Jun 2025 13:12:28 -0400 Message-ID: <20250603171228.597721946@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 03 Jun 2025 13:11:51 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Ye Bin Subject: [for-linus][PATCH 2/5] ftrace: Dont allocate ftrace module map if ftrace is disabled References: <20250603171149.582996770@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ye Bin If ftrace is disabled, it is meaningless to allocate a module map. Add a check in allocate_ftrace_mod_map() to not allocate if ftrace is disabled. Link: https://lore.kernel.org/20250529111955.2349189-3-yebin@huaweicloud.com Signed-off-by: Ye Bin Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 84fd2f8263fa..a7291685902e 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -7631,6 +7631,9 @@ allocate_ftrace_mod_map(struct module *mod, { struct ftrace_mod_map *mod_map; =20 + if (ftrace_disabled) + return NULL; + mod_map =3D kmalloc(sizeof(*mod_map), GFP_KERNEL); if (!mod_map) return NULL; --=20 2.47.2 From nobody Sun Feb 8 02:25:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 658E31DE881; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; cv=none; b=D7FXaIb1/kXKvpNdKR2G8mlq1fhTXTd9RnY6uAKSSaMUWn/HQNFxC8A5pXEPa+J7PX6ggqB4KctoHGtVmch1RKBlZJdQYH5mc6HAW7459l9HaCYuDAlBqKL6ZNVjjfwU08yeyxad/zDVZ5ZzD/zw0S0HKqIFmUEvukRzmaSBI1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; c=relaxed/simple; bh=lqbYtMtbV3zVzsS0m8EoAwgPYRF7eEhKzLoHcu/5wbQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ldAuEzB+vKwm5y7MRxl3te1pnqp24CvsXXJsROyCASqTJwCRqC0xI/uCUl2by2LIG7eIlhcObCPkXuJIjL8HFAkwmpbtxcuVZh6rmXflc9u1L8/27DWSmN7p6y1EQlMi5ngj85Um48aWJAHBxS3+NpVebxVEfhGAam5HUOtoNTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA078C4CEF4; Tue, 3 Jun 2025 17:11:13 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uMVBc-0000000E40Y-3psS; Tue, 03 Jun 2025 13:12:28 -0400 Message-ID: <20250603171228.762591654@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 03 Jun 2025 13:11:52 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , netdev , Jonathan Lemon , Jesper Dangaard Brouer , Jakub Kicinski Subject: [for-linus][PATCH 3/5] xdp: Remove unused mem_return_failed event References: <20250603171149.582996770@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt The change to allow page_pool to handle its own page destruction instead of relying on XDP removed the trace_mem_return_failed() tracepoint caller, but did not remove the mem_return_failed trace event. As trace events take up memory when they are created regardless of if they are used or not, having this unused event around wastes around 5K of memory. Remove the unused event. Link: https://lore.kernel.org/all/20250529130138.544ffec4@gandalf.local.hom= e/ Cc: netdev Cc: Jonathan Lemon Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Link: https://lore.kernel.org/20250529160550.1f888b15@gandalf.local.home Fixes: c3f812cea0d7 ("page_pool: do not release pool until inflight =3D=3D = 0.") Acked-by: Jesper Dangaard Brouer Acked-by: Jakub Kicinski Signed-off-by: Steven Rostedt (Google) Reviewed-by: John Fastabend --- include/trace/events/xdp.h | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h index a7e5452b5d21..d3ef86c97ae3 100644 --- a/include/trace/events/xdp.h +++ b/include/trace/events/xdp.h @@ -379,32 +379,6 @@ TRACE_EVENT(mem_connect, ) ); =20 -TRACE_EVENT(mem_return_failed, - - TP_PROTO(const struct xdp_mem_info *mem, - const struct page *page), - - TP_ARGS(mem, page), - - TP_STRUCT__entry( - __field(const struct page *, page) - __field(u32, mem_id) - __field(u32, mem_type) - ), - - TP_fast_assign( - __entry->page =3D page; - __entry->mem_id =3D mem->id; - __entry->mem_type =3D mem->type; - ), - - TP_printk("mem_id=3D%d mem_type=3D%s page=3D%p", - __entry->mem_id, - __print_symbolic(__entry->mem_type, __MEM_TYPE_SYM_TAB), - __entry->page - ) -); - TRACE_EVENT(bpf_xdp_link_attach_failed, =20 TP_PROTO(const char *msg), --=20 2.47.2 From nobody Sun Feb 8 02:25:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5605E1DDC1A for ; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; cv=none; b=aCvouFG/imyo3ohiI+CtjnOLGaqJHdvt90Sl3s2uDZTZLeL4Uut3U+T/m98zGs+74Xaq0JNw3fXiLhaFTyyzhQ3eKMrb8qlZC5tClmTBgUUTi4tlPFvSec27Ior7KHxXenrK9sSgHJbRWe71h4SoQTWX+5B9Rogq0h55zsu8vCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; c=relaxed/simple; bh=3SmGaj4dkxjHIqOv4YsRxaHyjciKTKc+dVkeo5BBZ08=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=V04mBypnKgIUSoIBOKJCmPXP9VT30NmbbetEPxHaU1gsAfC9Azq5s905b8GVownPadcVRR+QUxM54RGUgkrN/lahXfp19tcrDjjNk9gNLmfu/9rdUTV9P+qyD/Qqof9h7oHyTLcOG+MPNEOQTgsLkHJSrWDVP4WLmQQW+LDdZbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35BF5C4CEEF; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uMVBd-0000000E412-0MrW; Tue, 03 Jun 2025 13:12:29 -0400 Message-ID: <20250603171228.935644320@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 03 Jun 2025 13:11:53 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Juergen Gross , Thomas Gleixner Subject: [for-linus][PATCH 4/5] genirq/matrix: Remove unused irq_matrix_alloc_reserved tracepoint References: <20250603171149.582996770@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt The tracepoint irq_matrix_alloc_reserved was added but never used. Remove it. Link: https://lore.kernel.org/all/20250529130138.544ffec4@gandalf.local.hom= e/ Cc: Juergen Gross Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Link: https://lore.kernel.org/20250529135739.26e5c075@gandalf.local.home Fixes: ec0f7cd273dc4 ("genirq/matrix: Add tracepoints") Reviewed-by: Thomas Gleixner Signed-off-by: Steven Rostedt (Google) --- include/trace/events/irq_matrix.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/trace/events/irq_matrix.h b/include/trace/events/irq_m= atrix.h index 267d4cbbf360..93244078b4e6 100644 --- a/include/trace/events/irq_matrix.h +++ b/include/trace/events/irq_matrix.h @@ -138,14 +138,6 @@ DEFINE_EVENT(irq_matrix_global_update, irq_matrix_assi= gn_system, TP_ARGS(bit, matrix) ); =20 -DEFINE_EVENT(irq_matrix_cpu, irq_matrix_alloc_reserved, - - TP_PROTO(int bit, unsigned int cpu, - struct irq_matrix *matrix, struct cpumap *cmap), - - TP_ARGS(bit, cpu, matrix, cmap) -); - DEFINE_EVENT(irq_matrix_cpu, irq_matrix_reserve_managed, =20 TP_PROTO(int bit, unsigned int cpu, --=20 2.47.2 From nobody Sun Feb 8 02:25:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8327B1DF268 for ; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; cv=none; b=Wtit9j/MiJyRBUV2nPLi2Ki+N4X/TJpiTPaKz18OGp+aFuMy4XfyLjvq1IyWa9yy+ehjkyCa+souUxy8A/vph/EPi4ho92NnOBb3iog372+rUYGS+qqcUs28LSW/7Bw3xwxkWg1y4lFH6GFGxX6g1oF6123mbQAOYVABxVaMTc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748970674; c=relaxed/simple; bh=usGSICZBZcT+AQRM8OuiXrD2b9kfIFSK0gg2jjAzeIo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=nc8eHq/wEz77ZJQoDKWBg74PZaZBRGmWq2RgV9LJqp1MyxM9F6XLJRIMd821I2TmMFbJ1GQAw77lj+YfDtQfL/9TBnEr6yutvF5Q1tiVcZMK4V51K5DX1A9doN1GGgb42cP+1H4DUGux11YDErPToKIHHGl1Sqdem/zCZpgvl74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68DF9C4CEF6; Tue, 3 Jun 2025 17:11:14 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uMVBd-0000000E41W-15lR; Tue, 03 Jun 2025 13:12:29 -0400 Message-ID: <20250603171229.109414670@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 03 Jun 2025 13:11:54 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Dan Williams , Shiyang Ruan , "Darrick J. Wong" , Ross Zwisler , Alison Schofield Subject: [for-linus][PATCH 5/5] fsdax: Remove unused trace events for dax insert mapping References: <20250603171149.582996770@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt When the dax_fault_actor() helper was factored out, it removed the calls to the dax_pmd_insert_mapping and dax_insert_mapping events but never removed the events themselves. As each event created takes up memory (roughly 5K each), this is a waste as it is never used. Remove the unused dax_pmd_insert_mapping and dax_insert_mapping trace events. Link: https://lore.kernel.org/all/20250529130138.544ffec4@gandalf.local.hom= e/ Cc: Dan Williams Cc: Shiyang Ruan Cc: "Darrick J. Wong" Cc: Ross Zwisler Cc: Andrew Morton Link: https://lore.kernel.org/20250529152211.688800c9@gandalf.local.home Fixes: c2436190e492 ("fsdax: factor out a dax_fault_actor() helper") Reviewed-by: Alison Schofield Signed-off-by: Steven Rostedt (Google) Acked-by: Dan Williams --- include/trace/events/fs_dax.h | 78 ----------------------------------- 1 file changed, 78 deletions(-) diff --git a/include/trace/events/fs_dax.h b/include/trace/events/fs_dax.h index 86fe6aecff1e..76b56f78abb0 100644 --- a/include/trace/events/fs_dax.h +++ b/include/trace/events/fs_dax.h @@ -102,54 +102,6 @@ DEFINE_EVENT(dax_pmd_load_hole_class, name, \ DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole); DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole_fallback); =20 -DECLARE_EVENT_CLASS(dax_pmd_insert_mapping_class, - TP_PROTO(struct inode *inode, struct vm_fault *vmf, - long length, pfn_t pfn, void *radix_entry), - TP_ARGS(inode, vmf, length, pfn, radix_entry), - TP_STRUCT__entry( - __field(unsigned long, ino) - __field(unsigned long, vm_flags) - __field(unsigned long, address) - __field(long, length) - __field(u64, pfn_val) - __field(void *, radix_entry) - __field(dev_t, dev) - __field(int, write) - ), - TP_fast_assign( - __entry->dev =3D inode->i_sb->s_dev; - __entry->ino =3D inode->i_ino; - __entry->vm_flags =3D vmf->vma->vm_flags; - __entry->address =3D vmf->address; - __entry->write =3D vmf->flags & FAULT_FLAG_WRITE; - __entry->length =3D length; - __entry->pfn_val =3D pfn.val; - __entry->radix_entry =3D radix_entry; - ), - TP_printk("dev %d:%d ino %#lx %s %s address %#lx length %#lx " - "pfn %#llx %s radix_entry %#lx", - MAJOR(__entry->dev), - MINOR(__entry->dev), - __entry->ino, - __entry->vm_flags & VM_SHARED ? "shared" : "private", - __entry->write ? "write" : "read", - __entry->address, - __entry->length, - __entry->pfn_val & ~PFN_FLAGS_MASK, - __print_flags_u64(__entry->pfn_val & PFN_FLAGS_MASK, "|", - PFN_FLAGS_TRACE), - (unsigned long)__entry->radix_entry - ) -) - -#define DEFINE_PMD_INSERT_MAPPING_EVENT(name) \ -DEFINE_EVENT(dax_pmd_insert_mapping_class, name, \ - TP_PROTO(struct inode *inode, struct vm_fault *vmf, \ - long length, pfn_t pfn, void *radix_entry), \ - TP_ARGS(inode, vmf, length, pfn, radix_entry)) - -DEFINE_PMD_INSERT_MAPPING_EVENT(dax_pmd_insert_mapping); - DECLARE_EVENT_CLASS(dax_pte_fault_class, TP_PROTO(struct inode *inode, struct vm_fault *vmf, int result), TP_ARGS(inode, vmf, result), @@ -194,36 +146,6 @@ DEFINE_PTE_FAULT_EVENT(dax_load_hole); DEFINE_PTE_FAULT_EVENT(dax_insert_pfn_mkwrite_no_entry); DEFINE_PTE_FAULT_EVENT(dax_insert_pfn_mkwrite); =20 -TRACE_EVENT(dax_insert_mapping, - TP_PROTO(struct inode *inode, struct vm_fault *vmf, void *radix_entry), - TP_ARGS(inode, vmf, radix_entry), - TP_STRUCT__entry( - __field(unsigned long, ino) - __field(unsigned long, vm_flags) - __field(unsigned long, address) - __field(void *, radix_entry) - __field(dev_t, dev) - __field(int, write) - ), - TP_fast_assign( - __entry->dev =3D inode->i_sb->s_dev; - __entry->ino =3D inode->i_ino; - __entry->vm_flags =3D vmf->vma->vm_flags; - __entry->address =3D vmf->address; - __entry->write =3D vmf->flags & FAULT_FLAG_WRITE; - __entry->radix_entry =3D radix_entry; - ), - TP_printk("dev %d:%d ino %#lx %s %s address %#lx radix_entry %#lx", - MAJOR(__entry->dev), - MINOR(__entry->dev), - __entry->ino, - __entry->vm_flags & VM_SHARED ? "shared" : "private", - __entry->write ? "write" : "read", - __entry->address, - (unsigned long)__entry->radix_entry - ) -) - DECLARE_EVENT_CLASS(dax_writeback_range_class, TP_PROTO(struct inode *inode, pgoff_t start_index, pgoff_t end_index), TP_ARGS(inode, start_index, end_index), --=20 2.47.2