Re: the new VMt

Stephen C. Tweedie
2000-09-25T18:24:53Z

Hi,

On Mon, Sep 25, 2000 at 12:13:15PM -0600, yodaiken@fsmlabs.com wrote:

> > Definitely not. GFP_ATOMIC is reserved for things that really can't
> > swap or schedule right now. Use GFP_ATOMIC indiscriminately and you'll
> > have to increase the number of atomic-allocatable pages.
>
> Process 1,2 and 3 all start allocating 20 pages
> process 1 stalls after allocating 19
> some memory is freed and process 2 runs and stall after allocating 19
> some memory is free and process 3 runs and stalls after allocating 19
>
> now 57 pages are locked up in non-swapable kernel space and the system deadlocks OOM.

Or go the beancounter route: process 1 asks "can I pin 20 pages", gets
told "yes", and goes allocating them, blocking as necessary until it
gets them. Process 2 asks "can *I* pin 20 pages" and the answer is
either "not right now", in which case it waits for process 1 to
release its reservation, or "no, you've exceeded your user quota" in
which case it fails with ENOMEM. (That latter case can protect us
against a lot of DoS attacks from local users.)

The same accounting really needs to be done for page tables, as that
represents one of the biggest sources of unaccounted, unswappable
pages which user processes can cause to be created right now.

--Stephen