Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel: relay: use __GFP_ZERO in relay_alloc_buf

Passing the __GFP_ZERO flag to alloc_page should result in less overhead
th= an using memset()

Link: https://lkml.kernel.org/r/20250610225639.314970-3-git@elijahs.space
Signed-off-by: Elijah Wright <git@elijahs.space>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Elijah Wright and committed by
Andrew Morton
0ba5a25a f7b0ff2b

+1 -2
+1 -2
kernel/relay.c
··· 118 118 return NULL; 119 119 120 120 for (i = 0; i < n_pages; i++) { 121 - buf->page_array[i] = alloc_page(GFP_KERNEL); 121 + buf->page_array[i] = alloc_page(GFP_KERNEL | __GFP_ZERO); 122 122 if (unlikely(!buf->page_array[i])) 123 123 goto depopulate; 124 124 set_page_private(buf->page_array[i], (unsigned long)buf); ··· 127 127 if (!mem) 128 128 goto depopulate; 129 129 130 - memset(mem, 0, *size); 131 130 buf->page_count = n_pages; 132 131 return mem; 133 132