lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH next] vt: fix a warning when kmalloc alloc large memory
On Sat, 28 Mar 2020, Chen Wandun wrote:

> If the memory size that use kmalloc() to allocate exceed MAX_ORDER pages,
> it will hit the WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)), so add memory
> allocation flag __GFP_NOWARN to silence a warning, othervise, it will
> cause panic if panic_on_warn is enable.

Wow! How do you manage that? You need something like a 1024x1024 text
screen to get such a big memory allocation.

Still, GFP_NOWARN is not a proper fix. This kmalloc() should rather be
replaced by vmalloc(), and corresponding kfree() should then be vfree().
There is no need for this allocation to be physically contiguous.


Nicolas

\
 
 \ /
  Last update: 2020-03-28 03:56    [W:0.073 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site