All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Jan Kara <jack@suse.cz>, linux-mm@kvack.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper
Date: Tue, 18 Mar 2014 11:25:50 +0100	[thread overview]
Message-ID: <20140318102550.GC10955@quack.suse.cz> (raw)
In-Reply-To: <532760CF.10704@intel.com>

On Mon 17-03-14 13:53:35, Dave Hansen wrote:
> On 03/17/2014 12:49 PM, Jan Kara wrote:
> > +int get_vaddr_pfns(unsigned long start, int nr_pfns, int write, int force,
> > +		   struct pinned_pfns *pfns)
> > +{
> ...
> > +	if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
> > +		pfns->got_ref = 1;
> > +		pfns->is_pages = 1;
> > +		ret = get_user_pages(current, mm, start, nr_pfns, write, force,
> > +				     pfns_vector_pages(pfns), NULL);
> > +		goto out;
> > +	}
> 
> Have you given any thought to how this should deal with VM_MIXEDMAP
> vmas?  get_user_pages() will freak when it hits the !vm_normal_page()
> test on the pfnmapped ones, and jump out.  Shouldn't get_vaddr_pfns() be
> able to handle those too?
  It could and it doesn't seem as a big complication. Although none of the
converted drivers need this functionality, I guess it makes sense to
implement this to make the API more consistent. So I can have a look at it
for the next iteration.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Jan Kara <jack@suse.cz>, linux-mm@kvack.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper
Date: Tue, 18 Mar 2014 11:25:50 +0100	[thread overview]
Message-ID: <20140318102550.GC10955@quack.suse.cz> (raw)
In-Reply-To: <532760CF.10704@intel.com>

On Mon 17-03-14 13:53:35, Dave Hansen wrote:
> On 03/17/2014 12:49 PM, Jan Kara wrote:
> > +int get_vaddr_pfns(unsigned long start, int nr_pfns, int write, int force,
> > +		   struct pinned_pfns *pfns)
> > +{
> ...
> > +	if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
> > +		pfns->got_ref = 1;
> > +		pfns->is_pages = 1;
> > +		ret = get_user_pages(current, mm, start, nr_pfns, write, force,
> > +				     pfns_vector_pages(pfns), NULL);
> > +		goto out;
> > +	}
> 
> Have you given any thought to how this should deal with VM_MIXEDMAP
> vmas?  get_user_pages() will freak when it hits the !vm_normal_page()
> test on the pfnmapped ones, and jump out.  Shouldn't get_vaddr_pfns() be
> able to handle those too?
  It could and it doesn't seem as a big complication. Although none of the
converted drivers need this functionality, I guess it makes sense to
implement this to make the API more consistent. So I can have a look at it
for the next iteration.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

--
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>

  reply	other threads:[~2014-03-18 10:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 19:49 [RFC] Helper to abstract vma handling in media layer Jan Kara
2014-03-17 19:49 ` Jan Kara
2014-03-17 19:49 ` [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 20:53   ` Dave Hansen
2014-03-17 20:53     ` Dave Hansen
2014-03-18 10:25     ` Jan Kara [this message]
2014-03-18 10:25       ` Jan Kara
2015-04-24 16:21   ` Jan Kara
2015-04-24 16:21     ` Jan Kara
2014-03-17 19:49 ` [PATCH 2/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 3/9] media: vb2: Teach vb2_queue_or_prepare_buf() to get pfns for user buffers Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 4/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use pinned pfns Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 5/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use pfns vector Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 6/9] media: vb2: Convert vb2_dc_get_userptr() " Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 7/9] media: vb2: Remove unused functions Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 8/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_pfn() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 9/9] staging: tidspbridge: Convert to get_vaddr_pfns() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-04-10 10:02 ` [RFC] Helper to abstract vma handling in media layer Marek Szyprowski
2014-04-10 10:02   ` Marek Szyprowski
2014-04-10 10:32   ` Jan Kara
2014-04-10 10:32     ` Jan Kara
2014-04-10 11:07     ` Hans Verkuil
2014-04-10 11:07       ` Hans Verkuil
2014-04-10 12:15       ` Jan Kara
2014-04-10 12:15         ` Jan Kara
2014-04-10 12:22         ` Hans Verkuil
2014-04-10 12:22           ` Hans Verkuil
2014-04-10 21:57           ` Jan Kara
2014-04-10 21:57             ` Jan Kara
2014-04-10 22:18             ` Jan Kara
2014-04-10 22:18               ` Jan Kara
2014-04-11  6:58               ` Hans Verkuil
2014-04-11  6:58                 ` Hans Verkuil
2014-04-14 21:19                 ` Jan Kara
2014-04-14 21:19                   ` Jan Kara

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=20140318102550.GC10955@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dave.hansen@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.