On Wed, Aug 20, 2025 at 11:01:00AM -0400, Waiman Long wrote:
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 84265983f239..eb4e0af5edba 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -856,13 +856,8 @@ static void delete_object_part(unsigned long ptr, size_t size,
raw_spin_lock_irqsave(&kmemleak_lock, flags); object = __find_and_remove_object(ptr, 1, objflags); - if (!object) { -#ifdef DEBUG - kmemleak_warn("Partially freeing unknown object at 0x%08lx (size %zu)\n", - ptr, size); -#endif + if (!object) goto unlock; - }
/* * Create one or two objects that may result from the memory block @@ -882,8 +877,14 @@ static void delete_object_part(unsigned long ptr, size_t size,
unlock: raw_spin_unlock_irqrestore(&kmemleak_lock, flags); - if (object) + if (object) { __delete_object(object); + } else { +#ifdef DEBUG + kmemleak_warn("Partially freeing unknown object at 0x%08lx (size %zu)\n", + ptr, size); +#endif + }
Anyway, I am not against using printk_deferred_enter/exit here. It is just that they should be used as a last resort if there is no easy way to work around it.
This works for me if Gu respins the patch
Thanks.