[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150511210533.GB1227@akamai.com>
Date: Mon, 11 May 2015 17:05:33 -0400
From: Eric B Munson <emunson@...mai.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Shuah Khan <shuahkh@....samsung.com>, linux-alpha@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
sparclinux@...r.kernel.org, linux-xtensa@...ux-xtensa.org,
linux-mm@...ck.org, linux-arch@...r.kernel.org,
linux-api@...r.kernel.org
Subject: Re: [PATCH 0/3] Allow user to request memory to be locked on page
fault
On Mon, 11 May 2015, Andrew Morton wrote:
> On Mon, 11 May 2015 10:36:18 -0400 Eric B Munson <emunson@...mai.com> wrote:
>
> > On Fri, 08 May 2015, Andrew Morton wrote:
> > ...
> >
> > >
> > > Why can't the application mmap only those parts of the file which it
> > > wants and mlock those?
> >
> > There are a number of problems with this approach. The first is it
> > presumes the program will know what portions are needed a head of time.
> > In many cases this is simply not true. The second problem is the number
> > of syscalls required. With my patches, a single mmap() or mlockall()
> > call is needed to setup the required locking. Without it, a separate
> > mmap call must be made for each piece of data that is needed. This also
> > opens up problems for data that is arranged assuming it is contiguous in
> > memory. With the single mmap call, the user gets a contiguous VMA
> > without having to know about it. mmap() with MAP_FIXED could address
> > the problem, but this introduces a new failure mode of your map
> > colliding with another that was placed by the kernel.
> >
> > Another use case for the LOCKONFAULT flag is the security use of
> > mlock(). If an application will be using data that cannot be written
> > to swap, but the exact size is unknown until run time (all we have a
> > build time is the maximum size the buffer can be). The LOCKONFAULT flag
> > allows the developer to create the buffer and guarantee that the
> > contents are never written to swap without ever consuming more memory
> > than is actually needed.
>
> What application(s) or class of applications are we talking about here?
>
> IOW, how generally applicable is this? It sounds rather specialized.
>
For the example of a large file, this is the usage pattern for a large
statical language model (probably applies to other statical or graphical
models as well). For the security example, any application transacting
in data that cannot be swapped out (credit card data, medical records,
etc).
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists