Use mwaitx when busy-waiting signals

Use mwaitx instructions when busy waiting for signals to reduce CPU
energy usage.
This can be disabled by setting HSA_ENABLE_MWAITX=0

Change-Id: Ic207895a491b2bf6dacba47ef0921df3faad5b5a
This commit is contained in:
David Yat Sin committed 2023-02-22 16:55:43 +00:00
1 parent 0ed1568afc
commit cc48dfdbff
8 files changed
+59 -14

No files matched your search

+15 -10
View File
@@ -482,19 +482,24 @@ typedef enum {
*/
HSA_AMD_SYSTEM_INFO_BUILD_VERSION = 0x200,
/**
* Returns true if hsa_amd_svm_* APIs are supported by the driver. The type of
* this attribute is bool.
*/
* Returns true if hsa_amd_svm_* APIs are supported by the driver. The type of
* this attribute is bool.
*/
HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED = 0x201,
// TODO: Should this be per Agent?
/**
* Returns true if all Agents have access to system allocated memory (such as
* that allocated by mmap, malloc, or new) by default.
* If false then system allocated memory may only be made SVM accessible to
* an Agent by declaration of accessibility with hsa_amd_svm_set_attributes.
* The type of this attribute is bool.
*/
HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT = 0x202
* Returns true if all Agents have access to system allocated memory (such as
* that allocated by mmap, malloc, or new) by default.
* If false then system allocated memory may only be made SVM accessible to
* an Agent by declaration of accessibility with hsa_amd_svm_set_attributes.
* The type of this attribute is bool.
*/
HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT = 0x202,
/**
* Returns true if mwaitx is enabled on this system
* The type of this attribute is bool.
*/
HSA_AMD_SYSTEM_INFO_MWAITX_ENABLED = 0x203
} hsa_system_info_t;
/**