[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 10:44:05 +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=NTFusKZ4cbi3kBlkqkpKnfA3hvI9tKTF/dHM/jhK5+Q=; b=Z/Ee/OBkUs/z8DNdopJIoBC5uBxzrnjNDtgIomP9gYmFDUbVB/I0SuAdYrW6j8nghvt5tbLMg1u4X8yF4idCqFsDYHd7mF9B9WBJU4dhKEfsxm1sywm92riX70BchC1M1UoxychiSKzw1nUM4ojtCD5MS76v7QKWnAjUhLz2SW3IE4o37cnJh5t0dofXq2qbj1dd3AOnpV6yfWN/ycFZwInTfOhi+S3ir0ckJFiZZRVxKuDgtk1q6A6m1IJhCYlOASS9ZA3Cv/dtjsqeGjQZqye0ENFc6J56Y058+ER0bRrvIi2+4ejnPc8VLOdNsNe1OEyftdY8/BsAlANV/lzIWw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bAq7/Z4dPemCpFunou+mMP5caV/9zZNUdHMUlI6q47YfjlN3jPDBu4blJn2DIxxyIWnJxx8uJjsxWLqVgZlgrCEvT9tjE75UhXr1Vmq1MKUjylKCsUwwGTYRrF5sv7pc7Ty8EX2xJT4gTxXWJ8wE9b1vOs7xPdxQVCHKHiJbxgXfu4Q4upC/4MKTkbBeIoEmsG+IxMJXZll8G+ghxjh+ACKXgpfv/JJd+3Qx45Xl5LuG9j8AK5mALypU5KfITyEf6k5ByG7wTGQkC4jvljJqv/IgEF9uIMTWs3omYIU2EqEKw9zmFnAGj84Vyxi3y3p7+KUccSb8nPFaZgdRgB46cA==
  • 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 08:44:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.04.2022 10:13, David Vrabel wrote:
> 
> 
> 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.

Oh, I see - fair point.

Jan

>> 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®.