Re: objrmap and vmtruncate

Andrea Arcangeli
2003-04-06T14:51:05Z

On Sat, Apr 05, 2003 at 11:38:36PM -0800, William Lee Irwin III wrote:
> On Sun, Apr 06, 2003 at 01:10:08AM +0200, Andrea Arcangeli wrote:
> > I still think we shouldn't associate any metadata with the nonlinear.
> > nonlinaer should be enabled via a sysctl and have it run at true full
> > speed, it's a bypass for the VM so you can mangle the pagetables from
> > userspace.
> > As soon as you start associating metadata to nonlinar, it's not the
> > "raw fast" thing anymore and it increases the complexity.
>
> One of the big reasons why it's desirable is to reduce the metadata,
> so I agree here.
>
>
> On Sun, Apr 06, 2003 at 01:10:08AM +0200, Andrea Arcangeli wrote:
> > running bochs after echoing 1 into a sysctl should be fine, like also
> > uml should echoing 1 into a sysctl to get revirtualized vsyscalls
> > (unless we make it a prctl but that'll be more complex and slower).
> > When bochs starts and runs the mmap(VM_NONLINEAR) it will get -EPERM and
> > it will fall into the mmap mode (for 2.4 anyways). Or they can as well
> > require the echoing so they won't need to maintain two modes.
> > the nonlinear should work only in a separate special vma, its current
> > api is very unclean since it can mix with original linear stuff into the
> > same linear vma, and it doesn't allow more than one file into the same
> > nonlinear vma. I still reccomend all my points that I posted yesterday
> > to change the API to something much more approriate.
>
> This is an unusual idea; I'd expect capable(CAP_IPC_LOCK) to suffice
> to provide the privilege checks for direct mlocking as well as other
> operations that lock memory (please don't look at hugetlbfs for this...).

that would be enough if you could ask any capability to those apps.
Still you could override the sysctl check and allow the
mmap(VM_NONLINEAR) to work even w/ the sysctl, iff CAP_IPC_LOCK is set,
that's certainly safe, I don't mind about it.

so it could be an additional way to gain access to such functionalty,
but it doesn't obviate the need of the sysctl IMHO.

Andrea