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

Re: [PATCH v3 2/2] xen/common: Use enhanced ASSERT_ALLOC_CONTEXT in xmalloc()



Hi,

On 07/05/2022 03:54, Henry Wang wrote:
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index e866e0d864..ea59cd1a4a 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -162,13 +162,6 @@
  static char __initdata opt_badpage[100] = "";
  string_param("badpage", opt_badpage);
-/*
- * Heap allocations may need TLB flushes which may require IRQs to be
- * enabled (except when only 1 PCPU is online).
- */
-#define ASSERT_ALLOC_CONTEXT() \
-    ASSERT(!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1))
-
FYI, the patch introducing ASSERT_ALLOC_CONTEXT() has been reverted. I intend to re-introduce it once your previous patch and the one fixing the ITS (not yet formally sent) have been committed.

I have also checked that none of the ASSERTs() would be triggered on my x86 setup. So:

Tested-by: Julien Grall <jgrall@xxxxxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>

On a side note (no action expected for you), I noticed that the ASSERT()s would only trigger from CPU2 and onwards at least for Arm. This is because num_online_cpus() would still be 1 when bringing-up CPU1.

I went through the original discussion and I am not sure why we switched from < SYS_STATE_smp_boot to num_online_cpus() (aside that Arm doesn't set it). Aynway, this is not a major issue here as this is an ASSERT().

Cheers,

--
Julien Grall



 


Rackspace

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