On Fri, 1 Aug 2025 23:09:31 -0400 Waiman Long llong@redhat.com wrote:
Thanks.
There have been a few kmemleak locking fixes lately.
I believe this fix is independent from the previous ones:
https://lkml.kernel.org/r/20250731-kmemleak_lock-v1-1-728fd470198f@debian.or... https://lkml.kernel.org/r/20250728190248.605750-1-longman@redhat.com
But can people please check?
I believe that __printk_safe_enter()/_printk_safe_exit() are for printk internal use only. The proper API to use should be printk_deferred_enter()/printk_deferred_exit() if we want to deferred the printing. Since kmemleak_lock will have been acquired with irq disabled, it meets the condition that printk_deferred_*() APIs can be used.
Gotcha, thanks.
kmemleak;c:__lookup_object() has a lot of callers. I hope you're correct that all have local irqs enabled, but I'll ask Gu to verify that then please send along a new patch which uses printk_deferred_enter()?