[RFC] Order 4 allocation failures in the MEI client driver

From: Rohit Agarwal
Date: Tue Aug 13 2024 - 04:47:25 EST


Hi All,

I am seeing an inconsistent allocation (kmalloc) failure in the mei client driver [1]
in chromebooks. The crash indicates the driver is requesting for an order 4 allocation
that is unavailable at that particular snapshot of the system.

I am new to this and do not know the history behind the roundup to order
4 [2]. According to the sources, order 4 allocations are not guaranteed and
should be avoided most of the time. And considering the chromebooks
limited memory, this may become an expected behavior.

Can we have more details on this as to why order 4 allocation is
required? Or can we have a lower order allocation request that can be
helpful for low memory platforms?

Some solutions that I explored and weren't applicable/helpful here:
1. using a vmalloc/kvmalloc instead of kmalloc (Due to DMA usage).
2. using a scatter gather list (Would require a lot of rework in the driver and still
not sure if that would work as it would require changes in the underlying layer as well)
3. retry mechanism (would help in few instances only).
4. allocating from the DMA pool?

Please help in this query and help me correct my understanding wherever wrong.
Thanks in advance!!!

Thanks,
Rohit.

[1] https://github.com/torvalds/linux/blob/master/drivers/misc/mei/client.c#L500
[2] https://lore.kernel.org/lkml/20180731063544.25540-10-tomas.winkler@xxxxxxxxx/