[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


  • To: David Vrabel <dvrabel@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 20 Apr 2022 08:26:08 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mE8ftP2l0OUfGr4rw3d+irpMjfRLgo/vGwXH8jh5ELo=; b=YJ2E6ENFT9eyxLvj2ePe2zQkH5MI5h62jenJ0S6FV4xUuNq/lXbltFVE77SMQon3ZQkIv6j4AqmTNfBq/qfP8w27xzWh6MaK1Uu6NFUrOmuE6dv8JLOu4W3NVItAQV8D3i1mVilXnu/or5Ht59OabQp5hBfHIaClQdSOvJuSTRsUpB/kswFlRhuc9RaLGQDEM6ftpoIXnz/0Fw0BIfor/acykNTSatE4H8AYVN25oD0kEo44vWZCVq7UZ+byJU02AB/9JWQPfEiCBufneH9/F0/YYoiweP+R/vlHzqaeqBwVZ2e2i5saEnBkhPK1mT3wdipvuxaGlsqQZzTKsTLyMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EErfmegagevATmGrYZ6D/y6xO8d63DZYuRMPzhL0pxgRKp1wwEN5wNC5cL03U94tYGJL4Vg3ZLAbVGprzkH/mucSVVKR3/t/lH7uMMD5EKJ+am0OKLSEim/meI8E8mM5wTB3U+MHTWFStxMo9bdM1ZXyDDoxR+zpvdOdnfEp8XYmMDlkBiw93igxNMQx30ZKmFDz1O8DKJ+y3/k6qnWAjLrs8UbQJ6EDNuFvZmlTWAyQ0ucX4lGNHDY5ZcVXUwkEwvO19Q0G/IwTavN/OSAkYBaetyHGYrpJ2gS7AunhG4JSin3Vdk2sC3SP92KNN8HPfZFNX8Xc+FNaeG25FIbOAg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, David Vrabel <dvrabel@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 20 Apr 2022 06:26:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

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

Jan




 


Rackspace

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