lkml.org 
[lkml]   [1996]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Bugs and wishes in memory management area
Date

Rob Riggs said:

> This would seem to imply that one can do:
>
> ptr = kmalloc(size, GFP_DMA | GFP_KERNEL);
>
> The comments in mm.h clearly state that "GFP_DMA" is a flag, not an
> actual priority level. However GFP_DMA & GFP_LEVEL_MASK = GFP_BUFFER.
> And GFP_BUFFER does not try very hard to free pages.

Yes you can do it, but it doesn't help. The problem is in get_free_pages, it
returns when there is enough free pages, or if called with the ATOMIC flag.
But it doesn't check if the free pages are actually suitable for the DMA
request. You can fix it easily with an extra if() that avoids returning NULL
when called (GFP_DMA | GFP_KERNEL), but this just results in randomly freeing
pages until success.

What is really needed is an algorithm to pick the pages, or you will swap
several MB in order to create a single 128k DMA buffer (I know, I've
tried...).

--
Jon. <jon@gte.esi.us.es, http://www.esi.us.es/~jon>

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.081 / U:1.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site