Re: Problem with >1 page GFP_KERNEL kmalloc()

Gerard Roudier (groudier@club-internet.fr)
Mon, 31 Mar 1997 00:10:42 +0000 (GMT)


I wrote the remarks below ( quoted > >) about an hypothetical shared pool
of ISA/DMAable memory.

Here is the context:

" ISA DMA capable interfaces need bounce buffers. Such hardwares have been
" designed when machines had very fiew memory and generally have very low
" performances.
" Making available a small pool of about 100K or a fiew more for such
" hardware is not expensive and should work with normal performance.

> > We only should be carefull about the following:
> >
> > - Drivers shall not request such memory at GFP_ATOMIC priority
> > or under interrupt when they want to be successfull.
> > - Drivers must free memory as soon as they do not need it more.
> > - The allocation function must allow callers to wait for
> > memory availability in normal situations.
>
> These are not however the right answers. Until you have a "coalesce"
> operation on your memory, eg by moving unlocked buffers around or
> discarding the right things you will have this problem.

I imagine that drivers only allocate memory from the pool for DMA
purpose and free such memory as soon as IO is complete in order this
memory will become available to other drivers which are perhaps
waiting for.

If coalescence is needed, it should be done in another area of memory
that donnot need to be DMAable from ISA bus and, if it is larger
that 1 PAGE, only need to be virtually contiguous.

Being given the poor performance of ISA boards and buses, such a memory
copy and such a small memory pool is the very low price to pay, unless
we just want to have a cake and to eat it.

Gerard.