From 9ce18f9fde29d799d9508ffce061bc530655ab74 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 25 Nov 2023 15:34:43 +0000 Subject: [PATCH] drop rcu-dump-memory-object-info-if-callback-function-is-.patch --- ...object-info-if-callback-function-is-.patch | 149 ------------------ ...e-positives-when-rcu-freeing-objects.patch | 2 +- queue-6.1/series | 1 - ...object-info-if-callback-function-is-.patch | 149 ------------------ ...e-positives-when-rcu-freeing-objects.patch | 2 +- queue-6.5/series | 1 - ...srcu-only-accelerate-on-enqueue-time.patch | 13 +- ...object-info-if-callback-function-is-.patch | 149 ------------------ ...e-positives-when-rcu-freeing-objects.patch | 2 +- queue-6.6/series | 1 - ...srcu-only-accelerate-on-enqueue-time.patch | 13 +- 11 files changed, 11 insertions(+), 471 deletions(-) delete mode 100644 queue-6.1/rcu-dump-memory-object-info-if-callback-function-is-.patch delete mode 100644 queue-6.5/rcu-dump-memory-object-info-if-callback-function-is-.patch delete mode 100644 queue-6.6/rcu-dump-memory-object-info-if-callback-function-is-.patch diff --git a/queue-6.1/rcu-dump-memory-object-info-if-callback-function-is-.patch b/queue-6.1/rcu-dump-memory-object-info-if-callback-function-is-.patch deleted file mode 100644 index 510eb443d9b..00000000000 --- a/queue-6.1/rcu-dump-memory-object-info-if-callback-function-is-.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 05fad3fe13cf271e98133db13a9ddb26cef0b7b6 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 5 Aug 2023 11:17:26 +0800 -Subject: rcu: Dump memory object info if callback function is invalid - -From: Zhen Lei - -[ Upstream commit 2cbc482d325ee58001472c4359b311958c4efdd1 ] - -When a structure containing an RCU callback rhp is (incorrectly) freed -and reallocated after rhp is passed to call_rcu(), it is not unusual for -rhp->func to be set to NULL. This defeats the debugging prints used by -__call_rcu_common() in kernels built with CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, -which expect to identify the offending code using the identity of this -function. - -And in kernels build without CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, things -are even worse, as can be seen from this splat: - -Unable to handle kernel NULL pointer dereference at virtual address 0 -... ... -PC is at 0x0 -LR is at rcu_do_batch+0x1c0/0x3b8 -... ... - (rcu_do_batch) from (rcu_core+0x1d4/0x284) - (rcu_core) from (__do_softirq+0x24c/0x344) - (__do_softirq) from (__irq_exit_rcu+0x64/0x108) - (__irq_exit_rcu) from (irq_exit+0x8/0x10) - (irq_exit) from (__handle_domain_irq+0x74/0x9c) - (__handle_domain_irq) from (gic_handle_irq+0x8c/0x98) - (gic_handle_irq) from (__irq_svc+0x5c/0x94) - (__irq_svc) from (arch_cpu_idle+0x20/0x3c) - (arch_cpu_idle) from (default_idle_call+0x4c/0x78) - (default_idle_call) from (do_idle+0xf8/0x150) - (do_idle) from (cpu_startup_entry+0x18/0x20) - (cpu_startup_entry) from (0xc01530) - -This commit therefore adds calls to mem_dump_obj(rhp) to output some -information, for example: - - slab kmalloc-256 start ffff410c45019900 pointer offset 0 size 256 - -This provides the rough size of the memory block and the offset of the -rcu_head structure, which as least provides at least a few clues to help -locate the problem. If the problem is reproducible, additional slab -debugging can be enabled, for example, CONFIG_DEBUG_SLAB=y, which can -provide significantly more information. - -Signed-off-by: Zhen Lei -Signed-off-by: Paul E. McKenney -Signed-off-by: Frederic Weisbecker -Signed-off-by: Sasha Levin ---- - kernel/rcu/rcu.h | 7 +++++++ - kernel/rcu/srcutiny.c | 1 + - kernel/rcu/srcutree.c | 1 + - kernel/rcu/tasks.h | 1 + - kernel/rcu/tiny.c | 1 + - kernel/rcu/tree.c | 1 + - 6 files changed, 12 insertions(+) - -diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h -index 48d8f754b730e..49ff955ed2034 100644 ---- a/kernel/rcu/rcu.h -+++ b/kernel/rcu/rcu.h -@@ -10,6 +10,7 @@ - #ifndef __LINUX_RCU_H - #define __LINUX_RCU_H - -+#include - #include - - /* -@@ -211,6 +212,12 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head) - } - #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ - -+static inline void debug_rcu_head_callback(struct rcu_head *rhp) -+{ -+ if (unlikely(!rhp->func)) -+ kmem_dump_obj(rhp); -+} -+ - extern int rcu_cpu_stall_suppress_at_boot; - - static inline bool rcu_stall_is_suppressed_at_boot(void) -diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c -index 33adafdad2613..5e7f336baa06a 100644 ---- a/kernel/rcu/srcutiny.c -+++ b/kernel/rcu/srcutiny.c -@@ -138,6 +138,7 @@ void srcu_drive_gp(struct work_struct *wp) - while (lh) { - rhp = lh; - lh = lh->next; -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c -index 4db36d543be37..ce60cdf069e3a 100644 ---- a/kernel/rcu/srcutree.c -+++ b/kernel/rcu/srcutree.c -@@ -1564,6 +1564,7 @@ static void srcu_invoke_callbacks(struct work_struct *work) - rhp = rcu_cblist_dequeue(&ready_cbs); - for (; rhp != NULL; rhp = rcu_cblist_dequeue(&ready_cbs)) { - debug_rcu_head_unqueue(rhp); -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h -index c1f18c63b9b14..98370f6c225dc 100644 ---- a/kernel/rcu/tasks.h -+++ b/kernel/rcu/tasks.h -@@ -487,6 +487,7 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu - raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags); - len = rcl.len; - for (rhp = rcu_cblist_dequeue(&rcl); rhp; rhp = rcu_cblist_dequeue(&rcl)) { -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c -index a33a8d4942c37..21c040cba4bd0 100644 ---- a/kernel/rcu/tiny.c -+++ b/kernel/rcu/tiny.c -@@ -97,6 +97,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head) - - trace_rcu_invoke_callback("", head); - f = head->func; -+ debug_rcu_head_callback(head); - WRITE_ONCE(head->func, (rcu_callback_t)0L); - f(head); - rcu_lock_release(&rcu_callback_map); -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 917a1e43f7839..50726adb4e0b5 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -2247,6 +2247,7 @@ static void rcu_do_batch(struct rcu_data *rdp) - trace_rcu_invoke_callback(rcu_state.name, rhp); - - f = rhp->func; -+ debug_rcu_head_callback(rhp); - WRITE_ONCE(rhp->func, (rcu_callback_t)0L); - f(rhp); - --- -2.42.0 - diff --git a/queue-6.1/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch b/queue-6.1/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch index 9abf7de771f..1cda375b57e 100644 --- a/queue-6.1/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch +++ b/queue-6.1/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman #include #include #include -@@ -3382,6 +3383,14 @@ void kvfree_call_rcu(struct rcu_head *he +@@ -3381,6 +3382,14 @@ void kvfree_call_rcu(struct rcu_head *he WRITE_ONCE(krcp->count, krcp->count + 1); diff --git a/queue-6.1/series b/queue-6.1/series index 2527df980b1..87b1b1f86d8 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1,7 +1,6 @@ locking-ww_mutex-test-fix-potential-workqueue-corrup.patch lib-generic-radix-tree.c-don-t-overflow-in-peek.patch perf-core-bail-out-early-if-the-request-aux-area-is-.patch -rcu-dump-memory-object-info-if-callback-function-is-.patch srcu-fix-srcu_struct-node-grpmask-overflow-on-64-bit.patch selftests-lkdtm-disable-config_ubsan_trap-in-test-co.patch clocksource-drivers-timer-imx-gpt-fix-potential-memo.patch diff --git a/queue-6.5/rcu-dump-memory-object-info-if-callback-function-is-.patch b/queue-6.5/rcu-dump-memory-object-info-if-callback-function-is-.patch deleted file mode 100644 index 7a7aede50c1..00000000000 --- a/queue-6.5/rcu-dump-memory-object-info-if-callback-function-is-.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 0763a36c99e66750a280b61311aa1aa0563d15b4 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 5 Aug 2023 11:17:26 +0800 -Subject: rcu: Dump memory object info if callback function is invalid - -From: Zhen Lei - -[ Upstream commit 2cbc482d325ee58001472c4359b311958c4efdd1 ] - -When a structure containing an RCU callback rhp is (incorrectly) freed -and reallocated after rhp is passed to call_rcu(), it is not unusual for -rhp->func to be set to NULL. This defeats the debugging prints used by -__call_rcu_common() in kernels built with CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, -which expect to identify the offending code using the identity of this -function. - -And in kernels build without CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, things -are even worse, as can be seen from this splat: - -Unable to handle kernel NULL pointer dereference at virtual address 0 -... ... -PC is at 0x0 -LR is at rcu_do_batch+0x1c0/0x3b8 -... ... - (rcu_do_batch) from (rcu_core+0x1d4/0x284) - (rcu_core) from (__do_softirq+0x24c/0x344) - (__do_softirq) from (__irq_exit_rcu+0x64/0x108) - (__irq_exit_rcu) from (irq_exit+0x8/0x10) - (irq_exit) from (__handle_domain_irq+0x74/0x9c) - (__handle_domain_irq) from (gic_handle_irq+0x8c/0x98) - (gic_handle_irq) from (__irq_svc+0x5c/0x94) - (__irq_svc) from (arch_cpu_idle+0x20/0x3c) - (arch_cpu_idle) from (default_idle_call+0x4c/0x78) - (default_idle_call) from (do_idle+0xf8/0x150) - (do_idle) from (cpu_startup_entry+0x18/0x20) - (cpu_startup_entry) from (0xc01530) - -This commit therefore adds calls to mem_dump_obj(rhp) to output some -information, for example: - - slab kmalloc-256 start ffff410c45019900 pointer offset 0 size 256 - -This provides the rough size of the memory block and the offset of the -rcu_head structure, which as least provides at least a few clues to help -locate the problem. If the problem is reproducible, additional slab -debugging can be enabled, for example, CONFIG_DEBUG_SLAB=y, which can -provide significantly more information. - -Signed-off-by: Zhen Lei -Signed-off-by: Paul E. McKenney -Signed-off-by: Frederic Weisbecker -Signed-off-by: Sasha Levin ---- - kernel/rcu/rcu.h | 7 +++++++ - kernel/rcu/srcutiny.c | 1 + - kernel/rcu/srcutree.c | 1 + - kernel/rcu/tasks.h | 1 + - kernel/rcu/tiny.c | 1 + - kernel/rcu/tree.c | 1 + - 6 files changed, 12 insertions(+) - -diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h -index 98c1544cf572b..7ae3496b0b58d 100644 ---- a/kernel/rcu/rcu.h -+++ b/kernel/rcu/rcu.h -@@ -10,6 +10,7 @@ - #ifndef __LINUX_RCU_H - #define __LINUX_RCU_H - -+#include - #include - - /* -@@ -248,6 +249,12 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head) - } - #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ - -+static inline void debug_rcu_head_callback(struct rcu_head *rhp) -+{ -+ if (unlikely(!rhp->func)) -+ kmem_dump_obj(rhp); -+} -+ - extern int rcu_cpu_stall_suppress_at_boot; - - static inline bool rcu_stall_is_suppressed_at_boot(void) -diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c -index 336af24e0fe35..c38e5933a5d69 100644 ---- a/kernel/rcu/srcutiny.c -+++ b/kernel/rcu/srcutiny.c -@@ -138,6 +138,7 @@ void srcu_drive_gp(struct work_struct *wp) - while (lh) { - rhp = lh; - lh = lh->next; -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c -index 253ed509b6abb..c6481032d42be 100644 ---- a/kernel/rcu/srcutree.c -+++ b/kernel/rcu/srcutree.c -@@ -1735,6 +1735,7 @@ static void srcu_invoke_callbacks(struct work_struct *work) - rhp = rcu_cblist_dequeue(&ready_cbs); - for (; rhp != NULL; rhp = rcu_cblist_dequeue(&ready_cbs)) { - debug_rcu_head_unqueue(rhp); -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h -index b770add3f8430..b64d45cdea9c4 100644 ---- a/kernel/rcu/tasks.h -+++ b/kernel/rcu/tasks.h -@@ -493,6 +493,7 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu - raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags); - len = rcl.len; - for (rhp = rcu_cblist_dequeue(&rcl); rhp; rhp = rcu_cblist_dequeue(&rcl)) { -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c -index 42f7589e51e09..fec804b790803 100644 ---- a/kernel/rcu/tiny.c -+++ b/kernel/rcu/tiny.c -@@ -97,6 +97,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head) - - trace_rcu_invoke_callback("", head); - f = head->func; -+ debug_rcu_head_callback(head); - WRITE_ONCE(head->func, (rcu_callback_t)0L); - f(head); - rcu_lock_release(&rcu_callback_map); -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 1449cb69a0e0e..9b9ebe6205b93 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -2131,6 +2131,7 @@ static void rcu_do_batch(struct rcu_data *rdp) - trace_rcu_invoke_callback(rcu_state.name, rhp); - - f = rhp->func; -+ debug_rcu_head_callback(rhp); - WRITE_ONCE(rhp->func, (rcu_callback_t)0L); - f(rhp); - --- -2.42.0 - diff --git a/queue-6.5/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch b/queue-6.5/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch index e7d76c2a701..b52b07e64fe 100644 --- a/queue-6.5/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch +++ b/queue-6.5/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman #include #include #include -@@ -3397,6 +3398,14 @@ void kvfree_call_rcu(struct rcu_head *he +@@ -3396,6 +3397,14 @@ void kvfree_call_rcu(struct rcu_head *he success = true; } diff --git a/queue-6.5/series b/queue-6.5/series index 717958c328f..a7c57518828 100644 --- a/queue-6.5/series +++ b/queue-6.5/series @@ -3,7 +3,6 @@ btrfs-abort-transaction-on-generation-mismatch-when-.patch lib-generic-radix-tree.c-don-t-overflow-in-peek.patch x86-retpoline-make-sure-there-are-no-unconverted-ret.patch perf-core-bail-out-early-if-the-request-aux-area-is-.patch -rcu-dump-memory-object-info-if-callback-function-is-.patch srcu-fix-srcu_struct-node-grpmask-overflow-on-64-bit.patch selftests-lkdtm-disable-config_ubsan_trap-in-test-co.patch clocksource-drivers-timer-imx-gpt-fix-potential-memo.patch diff --git a/queue-6.5/srcu-only-accelerate-on-enqueue-time.patch b/queue-6.5/srcu-only-accelerate-on-enqueue-time.patch index da96aa5d8a9..b3f2d44ed8f 100644 --- a/queue-6.5/srcu-only-accelerate-on-enqueue-time.patch +++ b/queue-6.5/srcu-only-accelerate-on-enqueue-time.patch @@ -29,14 +29,12 @@ Reviewed-by: Like Xu Signed-off-by: Frederic Weisbecker Signed-off-by: Sasha Levin --- - kernel/rcu/srcutree.c | 6 ++---- + kernel/rcu/srcutree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c -index 7522517b63b6f..2f770a9a2a13a 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c -@@ -782,8 +782,7 @@ static void srcu_gp_start(struct srcu_struct *ssp) +@@ -782,8 +782,7 @@ static void srcu_gp_start(struct srcu_st spin_lock_rcu_node(sdp); /* Interrupts already disabled. */ rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); @@ -46,7 +44,7 @@ index 7522517b63b6f..2f770a9a2a13a 100644 spin_unlock_rcu_node(sdp); /* Interrupts remain disabled. */ WRITE_ONCE(ssp->srcu_sup->srcu_gp_start, jiffies); WRITE_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay, 0); -@@ -1719,6 +1718,7 @@ static void srcu_invoke_callbacks(struct work_struct *work) +@@ -1719,6 +1718,7 @@ static void srcu_invoke_callbacks(struct ssp = sdp->ssp; rcu_cblist_init(&ready_cbs); spin_lock_irq_rcu_node(sdp); @@ -54,7 +52,7 @@ index 7522517b63b6f..2f770a9a2a13a 100644 rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); if (sdp->srcu_cblist_invoking || -@@ -1748,8 +1748,6 @@ static void srcu_invoke_callbacks(struct work_struct *work) +@@ -1747,8 +1747,6 @@ static void srcu_invoke_callbacks(struct */ spin_lock_irq_rcu_node(sdp); rcu_segcblist_add_len(&sdp->srcu_cblist, -len); @@ -63,6 +61,3 @@ index 7522517b63b6f..2f770a9a2a13a 100644 sdp->srcu_cblist_invoking = false; more = rcu_segcblist_ready_cbs(&sdp->srcu_cblist); spin_unlock_irq_rcu_node(sdp); --- -2.42.0 - diff --git a/queue-6.6/rcu-dump-memory-object-info-if-callback-function-is-.patch b/queue-6.6/rcu-dump-memory-object-info-if-callback-function-is-.patch deleted file mode 100644 index fda3d531124..00000000000 --- a/queue-6.6/rcu-dump-memory-object-info-if-callback-function-is-.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 21acc156139305952e8d8e9696d2246921d71b17 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 5 Aug 2023 11:17:26 +0800 -Subject: rcu: Dump memory object info if callback function is invalid - -From: Zhen Lei - -[ Upstream commit 2cbc482d325ee58001472c4359b311958c4efdd1 ] - -When a structure containing an RCU callback rhp is (incorrectly) freed -and reallocated after rhp is passed to call_rcu(), it is not unusual for -rhp->func to be set to NULL. This defeats the debugging prints used by -__call_rcu_common() in kernels built with CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, -which expect to identify the offending code using the identity of this -function. - -And in kernels build without CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, things -are even worse, as can be seen from this splat: - -Unable to handle kernel NULL pointer dereference at virtual address 0 -... ... -PC is at 0x0 -LR is at rcu_do_batch+0x1c0/0x3b8 -... ... - (rcu_do_batch) from (rcu_core+0x1d4/0x284) - (rcu_core) from (__do_softirq+0x24c/0x344) - (__do_softirq) from (__irq_exit_rcu+0x64/0x108) - (__irq_exit_rcu) from (irq_exit+0x8/0x10) - (irq_exit) from (__handle_domain_irq+0x74/0x9c) - (__handle_domain_irq) from (gic_handle_irq+0x8c/0x98) - (gic_handle_irq) from (__irq_svc+0x5c/0x94) - (__irq_svc) from (arch_cpu_idle+0x20/0x3c) - (arch_cpu_idle) from (default_idle_call+0x4c/0x78) - (default_idle_call) from (do_idle+0xf8/0x150) - (do_idle) from (cpu_startup_entry+0x18/0x20) - (cpu_startup_entry) from (0xc01530) - -This commit therefore adds calls to mem_dump_obj(rhp) to output some -information, for example: - - slab kmalloc-256 start ffff410c45019900 pointer offset 0 size 256 - -This provides the rough size of the memory block and the offset of the -rcu_head structure, which as least provides at least a few clues to help -locate the problem. If the problem is reproducible, additional slab -debugging can be enabled, for example, CONFIG_DEBUG_SLAB=y, which can -provide significantly more information. - -Signed-off-by: Zhen Lei -Signed-off-by: Paul E. McKenney -Signed-off-by: Frederic Weisbecker -Signed-off-by: Sasha Levin ---- - kernel/rcu/rcu.h | 7 +++++++ - kernel/rcu/srcutiny.c | 1 + - kernel/rcu/srcutree.c | 1 + - kernel/rcu/tasks.h | 1 + - kernel/rcu/tiny.c | 1 + - kernel/rcu/tree.c | 1 + - 6 files changed, 12 insertions(+) - -diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h -index 98e13be411afd..d612731feea48 100644 ---- a/kernel/rcu/rcu.h -+++ b/kernel/rcu/rcu.h -@@ -10,6 +10,7 @@ - #ifndef __LINUX_RCU_H - #define __LINUX_RCU_H - -+#include - #include - - /* -@@ -248,6 +249,12 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head) - } - #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ - -+static inline void debug_rcu_head_callback(struct rcu_head *rhp) -+{ -+ if (unlikely(!rhp->func)) -+ kmem_dump_obj(rhp); -+} -+ - extern int rcu_cpu_stall_suppress_at_boot; - - static inline bool rcu_stall_is_suppressed_at_boot(void) -diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c -index 336af24e0fe35..c38e5933a5d69 100644 ---- a/kernel/rcu/srcutiny.c -+++ b/kernel/rcu/srcutiny.c -@@ -138,6 +138,7 @@ void srcu_drive_gp(struct work_struct *wp) - while (lh) { - rhp = lh; - lh = lh->next; -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c -index 253ed509b6abb..c6481032d42be 100644 ---- a/kernel/rcu/srcutree.c -+++ b/kernel/rcu/srcutree.c -@@ -1735,6 +1735,7 @@ static void srcu_invoke_callbacks(struct work_struct *work) - rhp = rcu_cblist_dequeue(&ready_cbs); - for (; rhp != NULL; rhp = rcu_cblist_dequeue(&ready_cbs)) { - debug_rcu_head_unqueue(rhp); -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h -index 8d65f7d576a34..7c845532a50ac 100644 ---- a/kernel/rcu/tasks.h -+++ b/kernel/rcu/tasks.h -@@ -538,6 +538,7 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu - raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags); - len = rcl.len; - for (rhp = rcu_cblist_dequeue(&rcl); rhp; rhp = rcu_cblist_dequeue(&rcl)) { -+ debug_rcu_head_callback(rhp); - local_bh_disable(); - rhp->func(rhp); - local_bh_enable(); -diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c -index 42f7589e51e09..fec804b790803 100644 ---- a/kernel/rcu/tiny.c -+++ b/kernel/rcu/tiny.c -@@ -97,6 +97,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head) - - trace_rcu_invoke_callback("", head); - f = head->func; -+ debug_rcu_head_callback(head); - WRITE_ONCE(head->func, (rcu_callback_t)0L); - f(head); - rcu_lock_release(&rcu_callback_map); -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index cb1caefa8bd07..29e4acbafefda 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -2135,6 +2135,7 @@ static void rcu_do_batch(struct rcu_data *rdp) - trace_rcu_invoke_callback(rcu_state.name, rhp); - - f = rhp->func; -+ debug_rcu_head_callback(rhp); - WRITE_ONCE(rhp->func, (rcu_callback_t)0L); - f(rhp); - --- -2.42.0 - diff --git a/queue-6.6/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch b/queue-6.6/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch index 92692076c47..48c7695fdd1 100644 --- a/queue-6.6/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch +++ b/queue-6.6/rcu-kmemleak-ignore-kmemleak-false-positives-when-rcu-freeing-objects.patch @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman #include #include #include -@@ -3401,6 +3402,14 @@ void kvfree_call_rcu(struct rcu_head *he +@@ -3400,6 +3401,14 @@ void kvfree_call_rcu(struct rcu_head *he success = true; } diff --git a/queue-6.6/series b/queue-6.6/series index 90dcfb6ed2e..8ac724543d2 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -3,7 +3,6 @@ btrfs-abort-transaction-on-generation-mismatch-when-.patch lib-generic-radix-tree.c-don-t-overflow-in-peek.patch x86-retpoline-make-sure-there-are-no-unconverted-ret.patch perf-core-bail-out-early-if-the-request-aux-area-is-.patch -rcu-dump-memory-object-info-if-callback-function-is-.patch srcu-fix-srcu_struct-node-grpmask-overflow-on-64-bit.patch selftests-lkdtm-disable-config_ubsan_trap-in-test-co.patch clocksource-drivers-timer-imx-gpt-fix-potential-memo.patch diff --git a/queue-6.6/srcu-only-accelerate-on-enqueue-time.patch b/queue-6.6/srcu-only-accelerate-on-enqueue-time.patch index 5c6d085880d..50ab1459c69 100644 --- a/queue-6.6/srcu-only-accelerate-on-enqueue-time.patch +++ b/queue-6.6/srcu-only-accelerate-on-enqueue-time.patch @@ -29,14 +29,12 @@ Reviewed-by: Like Xu Signed-off-by: Frederic Weisbecker Signed-off-by: Sasha Levin --- - kernel/rcu/srcutree.c | 6 ++---- + kernel/rcu/srcutree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c -index 7522517b63b6f..2f770a9a2a13a 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c -@@ -782,8 +782,7 @@ static void srcu_gp_start(struct srcu_struct *ssp) +@@ -782,8 +782,7 @@ static void srcu_gp_start(struct srcu_st spin_lock_rcu_node(sdp); /* Interrupts already disabled. */ rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); @@ -46,7 +44,7 @@ index 7522517b63b6f..2f770a9a2a13a 100644 spin_unlock_rcu_node(sdp); /* Interrupts remain disabled. */ WRITE_ONCE(ssp->srcu_sup->srcu_gp_start, jiffies); WRITE_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay, 0); -@@ -1719,6 +1718,7 @@ static void srcu_invoke_callbacks(struct work_struct *work) +@@ -1719,6 +1718,7 @@ static void srcu_invoke_callbacks(struct ssp = sdp->ssp; rcu_cblist_init(&ready_cbs); spin_lock_irq_rcu_node(sdp); @@ -54,7 +52,7 @@ index 7522517b63b6f..2f770a9a2a13a 100644 rcu_segcblist_advance(&sdp->srcu_cblist, rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); if (sdp->srcu_cblist_invoking || -@@ -1748,8 +1748,6 @@ static void srcu_invoke_callbacks(struct work_struct *work) +@@ -1747,8 +1747,6 @@ static void srcu_invoke_callbacks(struct */ spin_lock_irq_rcu_node(sdp); rcu_segcblist_add_len(&sdp->srcu_cblist, -len); @@ -63,6 +61,3 @@ index 7522517b63b6f..2f770a9a2a13a 100644 sdp->srcu_cblist_invoking = false; more = rcu_segcblist_ready_cbs(&sdp->srcu_cblist); spin_unlock_irq_rcu_node(sdp); --- -2.42.0 - -- 2.47.3