Re: [Announce] BKL shifting into drivers and filesystems - beware

From: Rik van Riel (riel@conectiva.com.br)
Date: Sat Jul 15 2000 - 12:52:40 EST


On Sat, 15 Jul 2000, Andrea Arcangeli wrote:
> On Fri, 14 Jul 2000, Rik van Riel wrote:
>
> >Which is too late. That will lead to the typical
> >"DMA buffer allocation failed" error message and
> >the user will come to us complaining that the sound
> >card no longer works after applying the VM patch.
>
> Woops I was wrong when I said classzone doesn't balance the ZONE_DMA ;),
> you was right, I was condraddicting myself (so there's not the problem you
> mentioned above with classzone, but unfortunately classzone doesn't fix
> the wastage of the atomic memory in case somebody won't use the ZONE_DMA
> and we can't fix that at all because we must provide memory for atomic
> allocations). So my whole point was flawed, sorry. So we'll waste more
> memory and resources than 2.[02].x in case nobody will use the ZONE_DMA
> but for a good reason that is to provide memory to atomic allocations.
> Good, no point against that anymore.

The solution for this memory wastage is called the scavenge
queue. If we do that right we'll only have to keep free memory
around for _recursive_ allocations, and not for anything else.

(then we should be ok with 10 to 30 pages free per zone, just
to be on the safe side)

> However the zone_t is anyway necessary to optimize the memory
> balancing, thanks to it when somebody asks for a __GFP_DMA
> allocation and he have to block freeing memory himself,

This is absolutely WRONG!

The zone_t argument would make sense when the majority of
the allocations would require memory from a specific zone,
but in reality we observe that almost all allocations just
don't care from which zone the page is allocated.

(most allocations seem to be for userspace data, which can
live everywhere)

In that case you really want the VM subsystem to reuse the
*oldest* (or least used) page in the system, regardless of
where that page resides.

Not giving a zone_t argument to the page freeing routines
gives those routines the freedom to free the oldest pages
from the system first (up to a certain limit, of course),
usually clearing zone->zone_wake_kswapd for one zone only.

This will lead to the pages from that zone being reused
before the pages from other, more loaded, zones and will
make the system reuse the oldest pages first.

regards,

Rik

--
"What you're running that piece of shit Gnome?!?!"
       -- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:22 EST