Re: [RFC][PATCH] mm: fix page_mkclean() vs non-linear vmas

Nick Piggin
2007-03-08T12:19:46Z

On Thu, Mar 08, 2007 at 01:11:43PM +0100, Peter Zijlstra wrote:
> On Thu, 2007-03-08 at 12:48 +0100, Miklos Szeredi wrote:
> > > However this still leaves the non-linear reclaim (Nick pointed it out as
> > > a potential DoS and other people have corroborated this). I have no idea
> > > on that to do about that.
> >
> > OK, but that is a completely different problem, not affecting
> > page_mkclean() or msync().
> >
> > And it doesn't sound too hard to solve: when current algorithm doesn't
> > seem to be making progress, then it will have to be done the hard way,
> > searching for for all nonlinear ptes of a page to unmap.
>
> Ah, you see, but that is when you've already lost.
>
> The DoS is about the computational complexity of the reclaim, not if it
> will ever come out of it with free pages.

If we really want to, we could limit it to mlock for !root. This is
a reasonable way to solve the problem, and UML could fall back on
vma emulated version if they didn't want to use mlock memory...

Or we could limit the size/number of nonlinear vmas that could be
created.

But just quietly, I think there are probably a lot of other ways to
perform a local DoS anyway ;)