Re: [PATCH/RFC] - support inheritance of mlocks across fork/exec

Andrew Morton
2008-11-25T23:26:51Z

On Mon, 24 Nov 2008 16:21:46 -0500
Lee Schermerhorn <Lee.Schermerhorn@hp.com> wrote:

> PATCH/RFC - support inheritance of mlocks across fork/exec

Linux actually used to do this by mistake. We fixed it in
2.3.<mumble>, iirc.

> Against; 2.6.28-rc5-mmotm-081121
>
> Add support for mlockall(MCL_INHERIT|MCL_RECURSIVE):
> MCL_CURRENT|MCL_INHERIT - inherit memory locks across fork()
> MCL_FUTURE|MCL_INHERIT - inherit "MCL_FUTURE" semantics across
> fork() and exec().
> MCL_RECURSIVE - inherit across future generations.
>
> In support of a "lock prefix command"--e.g., mlock <cmd> <args> ...

I spent some time scratching my head over what "MCL_RECURSIVE - inherit
across future generations" means, then decided that I shouldn't need to
scratch.

This patch should get wider attention than just linux-mm denizens,
methinks.

So can you please beef up the MCL_RECURSIVE description, then resend
the patch, also cc'ing linux-kernel@vger.kernel.org,
linux-api@vger.kernel.org and linux-arch@vger.kernel.org?

Thanks.