2000-10-29 13:04:06

by Raul Miller

[permalink] [raw]
Subject: guarantee_memory() syscall?

Can anyone tell me about the viability of a guarantee_memory() syscall?

[I'm thinking: it would either kill the process, or allocate all virtual
memory needed for its shared libraries, buffers, allocated memory, etc.
Furthermore, it would render this process immune to the OOM killer,
unless it allocated further memory.]

Thanks,

--
Raul


2000-10-29 14:32:21

by Eric W. Biederman

[permalink] [raw]
Subject: Re: guarantee_memory() syscall?

Raul Miller <[email protected]> writes:

> Can anyone tell me about the viability of a guarantee_memory() syscall?
>
> [I'm thinking: it would either kill the process, or allocate all virtual
> memory needed for its shared libraries, buffers, allocated memory, etc.
> Furthermore, it would render this process immune to the OOM killer,
> unless it allocated further memory.]

Except for the OOM killer semantics mlockall already exists.

Eric

2000-10-29 14:55:28

by Alan

[permalink] [raw]
Subject: Re: guarantee_memory() syscall?

> Can anyone tell me about the viability of a guarantee_memory() syscall?
> [I'm thinking: it would either kill the process, or allocate all virtual
> memory needed for its shared libraries, buffers, allocated memory, etc.
> Furthermore, it would render this process immune to the OOM killer,
> unless it allocated further memory.]

Hack mode on:

Allocate an array of pages the required size and attach them to a process via
a device and mmap(). Basically you are just wanting to do private unswappable
pages so grab free pages in kernel memory and mmap them


2000-10-29 18:35:17

by James A Sutherland

[permalink] [raw]
Subject: Re: guarantee_memory() syscall?

On 29 Oct 2000, Eric W. Biederman wrote:

> Raul Miller <[email protected]> writes:
>
> > Can anyone tell me about the viability of a guarantee_memory() syscall?
> >
> > [I'm thinking: it would either kill the process, or allocate all virtual
> > memory needed for its shared libraries, buffers, allocated memory, etc.
> > Furthermore, it would render this process immune to the OOM killer,
> > unless it allocated further memory.]
>
> Except for the OOM killer semantics mlockall already exists.

More to the point, "immortality" is NOT a desirable "feature": the OOM
killer just kills things which must be killed to protect the overall
system. We'll have a finely adjustable memory killer daemon soon, which
will be a better solution.


James.