[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32E1700B9017364D9B60AED9960492BC211B07B7@FMSMSX107.amr.corp.intel.com>
Date: Mon, 7 Oct 2013 15:38:24 +0000
From: "Marciniszyn, Mike" <mike.marciniszyn@...el.com>
To: Jan Kara <jack@...e.cz>
CC: LKML <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
infinipath <infinipath@...el.com>,
Roland Dreier <roland@...nel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [PATCH 23/26] ib: Convert qib_get_user_pages() to
get_user_pages_unlocked()
> > This patch and the sibling ipath patch will nominally take the mmap_sem
> > twice where the old routine only took it once. This is a performance
> > issue.
> It will take mmap_sem only once during normal operation. Only if
> get_user_pages_unlocked() fail, we have to take mmap_sem again to undo
> the change of mm->pinned_vm.
>
> > Is the intent here to deprecate get_user_pages()?
The old code looked like:
__qib_get_user_pages()
(broken) ulimit test
for (...)
get_user_pages()
qib_get_user_pages()
mmap_sem lock
__qib_get_user_pages()
mmap_sem() unlock
The new code is:
get_user_pages_unlocked()
mmap_sem lock
get_user_pages()
mmap_sem unlock
qib_get_user_pages()
mmap_sem lock
ulimit test and locked pages maintenance
mmap_sem unlock
for (...)
get_user_pages_unlocked()
I count an additional pair of mmap_sem transactions in the normal case.
>
> > Could the lock limit test be pushed into another version of the
> > wrapper so that there is only one set of mmap_sem transactions?
> I'm sorry, I don't understand what you mean here...
>
This is what I had in mind:
get_user_pages_ulimit_unlocked()
mmap_sem lock
ulimit test and locked pages maintenance (from qib/ipath)
for (...)
get_user_pages_unlocked()
mmap_sem unlock
qib_get_user_pages()
get_user_pages_ulimit_unlocked()
This really pushes the code into a new wrapper common to ipath/qib and any others that might want to combine locking with ulimit enforcement.
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists