[lkml]   [1996]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 2.2.0 wishlist

On Sat, 15 Jun 1996 00:51:15 +0200 (MET DST), Jon Tombs
<> said:

> Stephen Tweedie said:
>> > * Allocate ftape DMA buffers (96KB!) on first open (free on last
>> > close) instead of during driver initialization; needs fixing
>> > the memory allocation code first ...
>> Impossible. DMA *needs* contiguous memory ...

> DMA is a pretty special case, and not that common, as open/insmod is
> not time critical, get free pages just needs to swap pages until the
> dma buffer is available. I once hacked get_free_pages to do this
> (currently it returns NULL if called with the ATOMIC flag, or if
> there is enough ram free, but not suitable for DMA (i.e. fragmented
> or above the DMA_LIMIT).

As I said in the post, I think this is the wrong approach.
get_free_pages() is performance-critical and we should avoid bloating
it with code like this. There may also be places where we WANT to
fail rather than retry.

A better solution would be to add a second wrapper function around
get_free_pages which tries to get the dma-able memory and which takes
appropriate action if that fails. There are a lot of clever things
you might want to try, such as reshuffling cache pages rather than
just swapping out, in order to minimise the impact of the procedure.
In any case, what we really want to do is to identify what memory we
want to use, lock it down, and free it, rather than just speculatively
freeing anything until a contiguous free region magically appears.

Stephen Tweedie <>
Department of Computer Science, Edinburgh University, Scotland.

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