[PATCH 27/28] hazptr: Add Bloom false-positive exact-match fallback
From: Kunwu Chan
Date: Wed Nov 04 2026 - 12:11:50 EST
After 200+ scan cycles without progress, do an exact-match
per-address walk to determine whether the address is truly
present in any per-CPU or overflow-list slot. If absent,
complete the waiter immediately. A wildcard counts as present.
Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>
---
kernel/hazptr.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/kernel/hazptr.c b/kernel/hazptr.c
index 66954251c332..13ae9eb26a8b 100644
--- a/kernel/hazptr.c
+++ b/kernel/hazptr.c
@@ -407,6 +407,7 @@ struct hazptr_waiter {
#endif
#ifdef CONFIG_HAZPTR_DRAIN_ASSIST
unsigned int drain_cycles;
+ unsigned int bloom_cycles; /* cycles since last exact match */
#endif
};
@@ -852,6 +853,18 @@ static void hazptr_scan_do_cycle(void)
mutex_unlock(&hazptr_phase_lock);
+ /* Bloom-false-positive fallback */
+ list_for_each_entry_safe(w, n, &hazptr_scan.scanning, node) {
+ w->bloom_cycles++;
+ if (w->bloom_cycles > 200) {
+ if (!hazptr_scan_walk(w->addr, NULL, NULL)) {
+ list_move(&w->node, &done);
+ } else {
+ w->bloom_cycles = 0;
+ }
+ }
+ }
+
list_for_each_entry_safe(w, n, &done, node) {
list_del_init(&w->node);
complete(&w->done);
--
2.43.0