LWN: Comments on "Alignment guarantees for kmalloc()" https://lwn.net/Articles/787740/ This is a special feed containing comments posted to the individual LWN article titled "Alignment guarantees for kmalloc()". en-us Sat, 27 Sep 2025 11:40:37 +0000 Sat, 27 Sep 2025 11:40:37 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Alignment guarantees for kmalloc() https://lwn.net/Articles/787919/ https://lwn.net/Articles/787919/ ncultra <div class="FormattedComment"> kmalloc_aligned is a natural solution that mirrors the posix_memaligned and aligned_alloc interfaces in glibc. <a href="https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html">https://www.gnu.org/software/libc/manual/html_node/Aligne...</a>.<br> <p> Specific alignment for memory objects is necessary for using many of the 128-512 bit registers and processor APIs that are more frequent these days for cryptography, image processing, etc. <br> <p> With the memory side-channel attacks we live with, cache-line alignment is also something that is frequently necessary for memory variables. I would use a kmalloc_aligned api as soon as it becomes available.<br> </div> Thu, 09 May 2019 12:39:44 +0000