[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Feb 2024 01:24:43 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Douglas Anderson <dianders@...omium.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Eric Biederman <ebiederm@...ssion.com>, Jan Kara <jack@...e.cz>,
Kees Cook <keescook@...omium.org>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc()
On Thu, Feb 01, 2024 at 05:12:03PM -0800, Douglas Anderson wrote:
> While browsing through ChromeOS crash reports, I found one with an
> allocation failure that looked like this:
>
> chrome: page allocation failure: order:7,
> mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO),
> nodemask=(null),cpuset=urgent,mems_allowed=0
That does seem bad ...
> @@ -16,14 +17,14 @@ static int __regset_get(struct task_struct *target,
> if (size > regset->n * regset->size)
> size = regset->n * regset->size;
> if (!p) {
> - to_free = p = kzalloc(size, GFP_KERNEL);
> + to_free = p = vmalloc(size);
It's my impression that sometimes this size might be relatively small?
Perhaps we should make this kvmalloc so that we can satisfy it from the
slab allocator if it is small?
Also, I assume that we don't rely on this memory being physically
contiguous; we don't, for example, do I/O on it?
Powered by blists - more mailing lists