[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190214201231.GC1739@ziepe.ca>
Date: Thu, 14 Feb 2019 13:12:31 -0700
From: Jason Gunthorpe <jgg@...pe.ca>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Daniel Jordan <daniel.m.jordan@...cle.com>,
akpm@...ux-foundation.org, dave@...olabs.net, jack@...e.cz,
cl@...ux.com, linux-mm@...ck.org, kvm@...r.kernel.org,
kvm-ppc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
alex.williamson@...hat.com, paulus@...abs.org,
benh@...nel.crashing.org, mpe@...erman.id.au, hao.wu@...el.com,
atull@...nel.org, mdf@...nel.org, aik@...abs.ru
Subject: Re: [PATCH 0/5] use pinned_vm instead of locked_vm to account pinned
pages
On Thu, Feb 14, 2019 at 11:33:53AM -0800, Ira Weiny wrote:
> > I think it had to do with double accounting pinned and mlocked pages
> > and thus delivering a lower than expected limit to userspace.
> >
> > vfio has this bug, RDMA does not. RDMA has a bug where it can
> > overallocate locked memory, vfio doesn't.
>
> Wouldn't vfio also be able to overallocate if the user had RDMA pinned pages?
Yes
> I think the problem is that if the user calls mlock on a large range then both
> vfio and RDMA could potentially overallocate even with this fix. This was your
> initial email to Daniel, I think... And Alex's concern.
Here are the possibilities
- mlock and pin on the same pages - RDMA respects the limit, VFIO halfs it.
- mlock and pin on different pages - RDMA doubles the limit, VFIO
respects it
- VFIO and RDMA in the same process, the limit is halfed or doubled, depending.
IHMO we should make VFIO & RDMA the same, and then decide what to do
about case #2.
> > Really unclear how to fix this. The pinned/locked split with two
> > buckets may be the right way.
>
> Are you suggesting that we have 2 user limits?
This is what RDMA has done since CL's patch.
It is very hard to fix as you need to track how many pages are mlocked
*AND* pinned.
Jason
Powered by blists - more mailing lists