Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e67b7ce3 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

fs/seq_file: Use vmalloc by default for allocations > PAGE_SIZE



Some OOM implementations are pretty trigger happy when it comes to
releasing memory for kmalloc() allocations.  We might as well head
straight to vmalloc for allocations over PAGE_SIZE.

Change-Id: Ic0dedbadc8bf551d34cc5d77c8073938d4adef80
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 53f0b618
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -36,9 +36,11 @@ static void *seq_buf_alloc(unsigned long size)
{
	void *buf;

	buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
	if (!buf && size > PAGE_SIZE)
	if (size > PAGE_SIZE)
		buf = vmalloc(size);
	else
		buf = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);

	return buf;
}