Re: [RFC] mm: generic adaptive large memory allocation APIs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jiri Slaby
Date: Thursday, May 13, 2010 - 1:43 am

On 05/13/2010 06:45 AM, KOSAKI Motohiro wrote:

Hi, I suppose you mean the kmalloc allocation -- so kmalloc should fail
iff alloc_pages_exact (unless somebody frees a heap of memory indeed)?


These functions are a replacement for explicit
if (!(x = kmalloc()))
   x = vmalloc();
...
if (is_vmalloc(x))
  vfree(x);
else
  kfree(x);
in the code (like fdtable does this).

The 128M limit on x86_32 for vmalloc is configurable so if drivers in
sum need more on some specific hardware, it can be increased on the
command line (I had to do this on one machine in the past).

Anyway as this is a replacement for explicit tests, it shouldn't change
the behaviour in any way. Obviously when a user doesn't need virtually
contiguous space, he shouldn't use this interface at all.

thanks,
-- 
js
suse labs
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] mm: generic adaptive large memory allocation APIs, KOSAKI Motohiro, (Wed May 12, 9:45 pm)
Re: [RFC] mm: generic adaptive large memory allocation APIs, Jiri Slaby, (Thu May 13, 1:43 am)
Re: [RFC] mm: generic adaptive large memory allocation APIs, KOSAKI Motohiro, (Thu May 13, 2:05 am)
Re: [RFC] mm: generic adaptive large memory allocation APIs, KOSAKI Motohiro, (Thu May 13, 2:40 am)
Re: [RFC] mm: generic adaptive large memory allocation APIs, KOSAKI Motohiro, (Thu May 13, 3:43 am)