[PATCH][next] ACPI: align slab for improved memory performance

From: Colin Ian King
Date: Thu Aug 08 2024 - 18:21:50 EST


Enabling SLAB_HWCACHE_ALIGN for the ACPI object caches improves
boot speed in the ACPICA core for object allocation and free'ing
especially in the AML parsing and execution phases in boot. Testing
with 100 boots shows an average boot saving in acpi_init of ~35000
usecs compared to the unaligned version. Most of the ACPI objects
being allocated and free'd are of very short life times in the
critical paths for parsing and execution, so the extra memory used
for alignment isn't too onerous.

Signed-off-by: Colin Ian King <colin.king@xxxxxxxxx>
---
drivers/acpi/osl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 70af3fbbebe5..dab3d5089635 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1549,7 +1549,7 @@ void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags not_used)
acpi_status
acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t **cache)
{
- *cache = kmem_cache_create(name, size, 0, 0, NULL);
+ *cache = kmem_cache_create(name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
if (*cache == NULL)
return AE_ERROR;
else
--
2.45.2