Re: [patch][rfc] acpi: do not use kmem caches

Pekka Enberg
2008-12-01T17:48:25Z

On Mon, Dec 1, 2008 at 7:36 PM, Alexey Starikovskiy <aystarik@gmail.com> wrote:
>> [ The size of ACPI kmem caches with wasted bytes per object in
>> parenthesis. ]
>>
>> 32-bit size 64-bit size
>> Acpi-Namespace 24 (8) 32 (0)
>> Acpi-Operand 40 (24) 72 (24)
>> Acpi-Parse 32 (0) 48 (16)
>> Acpi-ParseExt 44 (20) 72 (24)
>> Acpi-State 44 (20) 80 (16)
>>
>> Though I suspect this situation could be improved by avoiding those
>> fairly big unions ACPI does (like union acpi_operand_object).
>
> No, last time I checked, operand may get down to 16 bytes in 32-bit case --
> save byte by having 3 types of operands... and making 2 more caches :)

I'm not sure what you mean. I wasn't suggesting adding new caches but
instead, avoid big unions and allocate plain structs with kmalloc()
instead. If you look at union acpi_operand_object, for example, it's
such a bad fit on 64-bit (72 bytes) only because of struct
acpi_object_mutex. Other structs in that union fit in a kmalloc-64
cache just fine.

So really, ACPI should probably be fixing the unions rather than paper
over the problem by adding new kmem caches.