All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <shijie8@gmail.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Minchan Kim <minchan.kim@gmail.com>,
	linux-mm@kvack.org, Huang Shijie <shijie8@gmail.com>
Subject: Re: Does get_user_pages_fast lock the user pages in memory in my case?
Date: Mon, 20 Apr 2009 16:23:57 +0800	[thread overview]
Message-ID: <49EC311D.4090605@gmail.com> (raw)
In-Reply-To: <20090420165529.61AB.A69D9226@jp.fujitsu.com>

KOSAKI Motohiro a??e??:
>> http://v4l2spec.bytesex.org/spec/r13696.htm
>> shows the vidioc_reqbufs(). It determines the method of IO : "Memory 
>> Mapping or User Pointer I/O"
>>
>> The application developers can support any methodes of the Two, there is 
>> no mandatory request to realize
>> both methods.   For example, the Mplayer only support the "memory 
>> maping" method ,and it does't support the "user pointer",
>> while the VLC supports both.
>>     
>
> I greped VIDIOC_REQBUFS on current tree.
> Almost driver has following check.
>
>         if (rb->memory != V4L2_MEMORY_MMAP)
> 		return -EINVAL;
>
> IOW, almost one don't provide V4L2_MEMORY_USERPTR method.
> Thus, I think any userland application don't want use V4L2_MEMORY_USERPTR.
> I recommend you also return -EINVAL.
>
>   
Thanks.

In the V4L2_MEMORY_USERPTR method, what I want to do is pin the 
anonymous pages in memory.

I used to add the VM_LOCKED to vma associated with the pages.In my 
opinion, the pages will:
LRU_ACTIVE_ANON ---> LRU_INACTIVE_ANON---> LRU_UNEVICTABLE

so the pages are pinned in memory.It was ugly, but it works I think.
Do you have any suggestions about this method?





> I think we can't implement V4L2_MEMORY_USERPTR properly.
> it is mistake by specification.
>
>
>
>
>
>   

--
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:[~2009-04-20  8:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17  7:01 Does get_user_pages_fast lock the user pages in memory in my case? Huang Shijie
2009-04-18  6:18 ` KOSAKI Motohiro
2009-04-20  2:22   ` Huang Shijie
2009-04-19 23:45 ` Minchan Kim
2009-04-20  2:15   ` Huang Shijie
2009-04-20  2:42     ` Minchan Kim
2009-04-20  3:28       ` Huang Shijie
2009-04-20  3:42         ` KOSAKI Motohiro
2009-04-20  4:53         ` Minchan Kim
2009-04-20  5:05           ` KOSAKI Motohiro
2009-04-20  5:05           ` Huang Shijie
2009-04-20  5:19             ` KOSAKI Motohiro
2009-04-20  5:37               ` Huang Shijie
2009-04-20  7:59                 ` KOSAKI Motohiro
2009-04-20  8:23                   ` Huang Shijie [this message]
2009-04-20  9:24                     ` KOSAKI Motohiro
2009-04-20  9:47                       ` Huang Shijie
2009-04-21  1:43                         ` KOSAKI Motohiro
2009-04-21 19:47                         ` Christoph Lameter
2009-04-20  5:24             ` Minchan Kim
2009-04-20  5:42               ` Huang Shijie
2009-04-20  3:57       ` Huang Shijie
2009-04-22  6:08       ` Huang Shijie
2009-04-22  9:46         ` Minchan Kim
2009-04-20  3:18     ` KOSAKI Motohiro

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=49EC311D.4090605@gmail.com \
    --to=shijie8@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.com \
    /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.