[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] page_alloc: assert IRQs are enabled in heap alloc/free





On 20/04/2022 07:26, Jan Beulich wrote:
On 19.04.2022 17:01, David Vrabel wrote:
From: David Vrabel <dvrabel@xxxxxxxxxxxx>

Heap pages can only be safely allocated and freed with interuupts
enabled as they may require a TLB flush which will send IPIs.

Enhance the assertions in alloc_xenheap_pages() and
alloc_domheap_pages() to check interrupts are enabled. For consistency
the same asserts are used when freeing heap pages.

As an exception, during early boot when only 1 PCPU is online,
allocations are permitted with interrupts disabled.

This exception is tightly coupled with spin lock checking, i.e. the
point in time when spin_debug_enable() is called. I think this wants
making explicit at least in the code comment, but as a result I also
wonder in how far the extended assertions are really worthwhile: Any
violation would be detected in check_lock() anyway. Thoughts?

I was caught out by stop_machine_run() disabling both interrupts and spin lock debugging when running the action function, so check_lock() didn't help in this (admittedly) narrow use case.

Furthermore I'm concerned of Arm not using either SYS_STATE_smp_boot
or spin_debug_enable().

David



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.