Implementing alignment guarantees for kmalloc()
Implementing alignment guarantees for kmalloc()
Posted Oct 21, 2019 16:48 UTC (Mon) by jreiser (subscriber, #11027)In reply to: Implementing alignment guarantees for kmalloc() by vbabka
Parent article: Implementing alignment guarantees for kmalloc()
The new alignment guarantees are only for power of two sizes... The result should be aligned to min(PAGE_SIZE, n & ~(-1+n)), which is the place value of the lowest-order '1' bit in the requested size (but limited to the sizeof one page). So if the request is for 40 bytes then the result should be 8-byte aligned. The rationale is: the alignment of a struct having that size.
Posted Oct 22, 2019 19:55 UTC (Tue)
by wilevers (subscriber, #110407)
[Link] (1 responses)
Posted Oct 23, 2019 14:20 UTC (Wed)
by rweikusat2 (subscriber, #117920)
[Link]
Implementing alignment guarantees for kmalloc()
Implementing alignment guarantees for kmalloc()