Re: [PATCH v1 2/2] mm/show_mem: Add trylock while printing alloc info

From: Vlastimil Babka
Date: Thu Aug 28 2025 - 13:21:48 EST


On 8/28/25 18:35, Shakeel Butt wrote:
> On Thu, Aug 28, 2025 at 10:41:23AM +0200, Vlastimil Babka wrote:
>> >
>> > I was not aware of interrupt context before. I will change to test-and-set
>> > lock in the next version.
>>
>> Perhaps simply spinlock_t with spin_trylock()?
>>
>
> Will lockdep complain that this spinlock is taken in non-irq and irq
> context without disabling irqs?

If we only use spin_trylock then it won't.