From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Davidlohr Bueso <davidlohr@hp.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Sasha Levin <sasha.levin@oracle.com>,
Wanpeng Li <liwanp@linux.vnet.ibm.com>,
Vlastimil Babka <vbabka@suse.cz>,
"Jo\"rn Engel" <joern@logfs.org>,
"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
Alexander Graf <agraf@suse.de>,
Michael Ellerman <michael@ellerman.id.au>
Subject: Re: [RFC PATCH] mm: Add helpers for locked_vm
Date: Fri, 01 Aug 2014 20:08:02 +1000 [thread overview]
Message-ID: <1406887682.4935.239.camel@pasglop> (raw)
In-Reply-To: <20140730124748.GK19379@twins.programming.kicks-ass.net>
On Wed, 2014-07-30 at 14:47 +0200, Peter Zijlstra wrote:
> On Wed, Jul 30, 2014 at 10:30:48PM +1000, Alexey Kardashevskiy wrote:
> >
> > No, this is not my intention here. Here I only want to increment the counter.
>
> Full and hard nack on that. It should always be tied to actual pages, we
> should not detach this and make it 'a number'.
But this is the only way. We *cannot* go through the whole per-page
locking logic every time the guest puts a translation into the IOMMU,
this will completely kill guest performances for pass-through devices.
Worse, for performances, because populating the iommu is a hypercall,
we want to do it in "real mode" (special MMU-off environment) where we
cannot rely on most normal kernel services such as normal locks, vmalloc
space isn't accessible etc...
So we don't have a choice. Either we let guests randomly pin arbitrary
amounts of system memory, or we have a way to predictively account for
the maximum that *can* be mapped/pinned in the iommu table to enable
the fast path.
Another problem with the mlock logic is that it doesn't refcount how
many time a page has been locked, while the guest can map a given page
multiple time in the iommu.
Ben.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-08-01 11:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-30 9:28 [RFC PATCH] mm: Add helpers for locked_vm Alexey Kardashevskiy
2014-07-30 10:12 ` Peter Zijlstra
2014-07-30 10:31 ` Davidlohr Bueso
2014-07-30 12:30 ` Alexey Kardashevskiy
2014-07-30 12:47 ` Peter Zijlstra
2014-08-01 10:08 ` Benjamin Herrenschmidt [this message]
2014-08-01 10:04 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406887682.4935.239.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=aarcange@redhat.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=davidlohr@hp.com \
--cc=hannes@cmpxchg.org \
--cc=joern@logfs.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liwanp@linux.vnet.ibm.com \
--cc=mgorman@suse.de \
--cc=michael@ellerman.id.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=sasha.levin@oracle.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).