public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma: get_user_pages -> get_user_pages_fast
Date: Mon, 11 Oct 2010 19:34:56 +0200	[thread overview]
Message-ID: <1286818496.1998.43.camel@laptop> (raw)
In-Reply-To: <20101011165310.GA5122@redhat.com>

On Mon, 2010-10-11 at 18:53 +0200, Michael S. Tsirkin wrote:
> There doesn't seem to be any advantage to using
> get_user_pages, so switch iovlock to get_user_pages_fast
> instead.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> Lightly tested.  This patch is on top of the bugfix patch I posted
> previously.
> 
>  drivers/dma/iovlock.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/dma/iovlock.c b/drivers/dma/iovlock.c
> index 21ed8f3..c6917e8 100644
> --- a/drivers/dma/iovlock.c
> +++ b/drivers/dma/iovlock.c
> @@ -95,17 +95,11 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
>  		pages += page_list->nr_pages;
>  
>  		/* pin pages down */
> -		down_read(&current->mm->mmap_sem);
> -		ret = get_user_pages(
> -			current,
> -			current->mm,
> +		ret = get_user_pages_fast(
>  			(unsigned long) iov[i].iov_base,
>  			page_list->nr_pages,

What's the actual nr_pages here? Is it limited to some small number or
can it be arbitrarily large?

>  			1,	/* write */
> -			0,	/* force */
> -			page_list->pages,
> -			NULL);
> -		up_read(&current->mm->mmap_sem);
> +			page_list->pages);
>  
>  		if (unlikely(ret < 0))
>  			goto unpin;



  reply	other threads:[~2010-10-11 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 16:53 [PATCH] dma: get_user_pages -> get_user_pages_fast Michael S. Tsirkin
2010-10-11 17:34 ` Peter Zijlstra [this message]
2010-10-12 11:52   ` Michael S. Tsirkin
2010-10-12 12:08     ` Peter Zijlstra

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=1286818496.1998.43.camel@laptop \
    --to=peterz@infradead.org \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=tj@kernel.org \
    /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