From: Minchan Kim <minchan@kernel.org>
To: InKi Dae <daeinki@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Jerome Glisse <j.glisse@gmail.com>,
Inki Dae <inki.dae@samsung.com>,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
kyungmin.park@samsung.com, sw0312.kim@samsung.com,
linux-mm@kvack.org
Subject: Re: [PATCH 2/2 v3] drm/exynos: added userptr feature.
Date: Mon, 14 May 2012 13:29:27 +0900 [thread overview]
Message-ID: <4FB08A27.2040503@kernel.org> (raw)
In-Reply-To: <CAAQKjZPvLXYK5e385QE7HzmKqfUJr9G3+0HVvLeiXDG+yLDx+A@mail.gmail.com>
On 05/12/2012 01:48 PM, InKi Dae wrote:
> 2012/5/12 KOSAKI Motohiro <kosaki.motohiro@gmail.com>:
>> On Fri, May 11, 2012 at 7:29 PM, Jerome Glisse <j.glisse@gmail.com> wrote:
>>> On Fri, May 11, 2012 at 6:59 PM, KOSAKI Motohiro
>>> <kosaki.motohiro@gmail.com> wrote:
>>>>> My point is this ioctl will be restricted to one user (Xserver if i
>>>>> understand) and only this user, there is no fork in it so no need to
>>>>> worry about fork, just setting the vma as locked will be enough.
>>>>>
>>>>> But i don't want people reading this driver suddenly think that what
>>>>> it's doing is ok, it's not, it's hack and can never make to work
>>>>> properly on a general case, that's why it needs a big comment stating,
>>>>> stressing that. I just wanted to make sure Inki and Kyungmin
>>>>> understood that this kind of ioctl should be restricted to carefully
>>>>> selected user and that there is no way to make it general or reliable
>>>>> outside that.
>>>>
>>>>
>>>> first off, I'm not drm guy and then I don't intend to insist you. but if
>>>> application don't use fork, get_user_pages() has no downside. I guess we
>>>> don't need VM_LOCKED hack.
>>>>
>>>> but again, up to drm folks.
>>>
>>> You need the VM_LOCKED hack to mare sure that the xorg vma still point
>>> to the same page, afaict with get_user_pages pages can be migrated out
>>> of the anonymous vma so the vma might point to new page, while old
>>> page are still in use by the gpu and not recycle until their refcount
>>> drop to 0.
>>
>> afaik, get_user_pages() prevent page migration. (see
>> migrate_page_move_mapping). but mlock doesn't.
>
>
> I'd like to make sure some points before preparing next patch to
> userptr feature.
>
> in case that userptr ioctl can be accessed by user.
> 1. all the pages from get_user_pages can't be migrated by CMA and also
Yes. I already mentioned it.
> it doesn't need VM_LOCKED or VM_RESERVED flag.
Yes, if you just use that flag to prevent migration.
>
> 2. if VM_DONTCOPY is set to vma->flags then all the pages to this vma
> are safe from being COW.
Yes.
>
> 3. userptr ioctl has limited size and the limited size can be changed
> by only root user. this is for preventing from dropping system
> performance by malicious software.
IMHO, looks good to me but need answer from DRM guy on the question.
>
> with above actions taken, are there something we didn't care? if so,
> we will preparing next path for the userptr ioctl to be accessed by
> only root user. this means that this feature is used by only X Server
> but isn't used by any users. so we are going to wait something
> resolved fully. of course, as Jerome said, we wil add big comments
> describing this feature enough to next patch.
>
> Thanks,
> Inki Dae
>
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
Kind regards,
Minchan Kim
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan@kernel.org>
To: InKi Dae <daeinki@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Jerome Glisse <j.glisse@gmail.com>,
Inki Dae <inki.dae@samsung.com>,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
kyungmin.park@samsung.com, sw0312.kim@samsung.com,
linux-mm@kvack.org
Subject: Re: [PATCH 2/2 v3] drm/exynos: added userptr feature.
Date: Mon, 14 May 2012 13:29:27 +0900 [thread overview]
Message-ID: <4FB08A27.2040503@kernel.org> (raw)
In-Reply-To: <CAAQKjZPvLXYK5e385QE7HzmKqfUJr9G3+0HVvLeiXDG+yLDx+A@mail.gmail.com>
On 05/12/2012 01:48 PM, InKi Dae wrote:
> 2012/5/12 KOSAKI Motohiro <kosaki.motohiro@gmail.com>:
>> On Fri, May 11, 2012 at 7:29 PM, Jerome Glisse <j.glisse@gmail.com> wrote:
>>> On Fri, May 11, 2012 at 6:59 PM, KOSAKI Motohiro
>>> <kosaki.motohiro@gmail.com> wrote:
>>>>> My point is this ioctl will be restricted to one user (Xserver if i
>>>>> understand) and only this user, there is no fork in it so no need to
>>>>> worry about fork, just setting the vma as locked will be enough.
>>>>>
>>>>> But i don't want people reading this driver suddenly think that what
>>>>> it's doing is ok, it's not, it's hack and can never make to work
>>>>> properly on a general case, that's why it needs a big comment stating,
>>>>> stressing that. I just wanted to make sure Inki and Kyungmin
>>>>> understood that this kind of ioctl should be restricted to carefully
>>>>> selected user and that there is no way to make it general or reliable
>>>>> outside that.
>>>>
>>>>
>>>> first off, I'm not drm guy and then I don't intend to insist you. but if
>>>> application don't use fork, get_user_pages() has no downside. I guess we
>>>> don't need VM_LOCKED hack.
>>>>
>>>> but again, up to drm folks.
>>>
>>> You need the VM_LOCKED hack to mare sure that the xorg vma still point
>>> to the same page, afaict with get_user_pages pages can be migrated out
>>> of the anonymous vma so the vma might point to new page, while old
>>> page are still in use by the gpu and not recycle until their refcount
>>> drop to 0.
>>
>> afaik, get_user_pages() prevent page migration. (see
>> migrate_page_move_mapping). but mlock doesn't.
>
>
> I'd like to make sure some points before preparing next patch to
> userptr feature.
>
> in case that userptr ioctl can be accessed by user.
> 1. all the pages from get_user_pages can't be migrated by CMA and also
Yes. I already mentioned it.
> it doesn't need VM_LOCKED or VM_RESERVED flag.
Yes, if you just use that flag to prevent migration.
>
> 2. if VM_DONTCOPY is set to vma->flags then all the pages to this vma
> are safe from being COW.
Yes.
>
> 3. userptr ioctl has limited size and the limited size can be changed
> by only root user. this is for preventing from dropping system
> performance by malicious software.
IMHO, looks good to me but need answer from DRM guy on the question.
>
> with above actions taken, are there something we didn't care? if so,
> we will preparing next path for the userptr ioctl to be accessed by
> only root user. this means that this feature is used by only X Server
> but isn't used by any users. so we are going to wait something
> resolved fully. of course, as Jerome said, we wil add big comments
> describing this feature enough to next patch.
>
> Thanks,
> Inki Dae
>
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
Kind regards,
Minchan Kim
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-05-14 4:29 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 13:43 [PATCH 0/4] updated exynos-drm-next Inki Dae
2012-04-23 13:43 ` [PATCH 1/4] drm/exynos: added cache attribute support for gem Inki Dae
2012-04-23 13:43 ` [PATCH 2/4] drm/exynos: added drm prime feature Inki Dae
2012-04-23 13:43 ` [PATCH 3/4] drm/exynos: added userptr feature Inki Dae
2012-04-24 5:17 ` [PATCH v2 " Inki Dae
2012-04-25 10:15 ` Dave Airlie
2012-04-25 12:46 ` InKi Dae
2012-05-05 10:19 ` daeinki
2012-05-05 10:22 ` Dave Airlie
2012-05-07 18:18 ` Jerome Glisse
2012-05-08 7:59 ` Inki Dae
2012-05-08 15:05 ` Jerome Glisse
2012-05-08 6:48 ` Inki Dae
2012-05-09 6:17 ` [PATCH 0/2 v3] " Inki Dae
2012-05-09 6:17 ` [PATCH 1/2 v3] drm/exynos: added userptr limit ioctl Inki Dae
2012-05-09 6:17 ` [PATCH 2/2 v3] drm/exynos: added userptr feature Inki Dae
2012-05-09 14:45 ` Jerome Glisse
2012-05-09 18:32 ` Jerome Glisse
2012-05-10 2:44 ` Inki Dae
2012-05-10 15:05 ` Jerome Glisse
2012-05-10 15:31 ` Daniel Vetter
2012-05-10 15:31 ` Daniel Vetter
2012-05-10 15:52 ` Jerome Glisse
2012-05-11 1:47 ` Inki Dae
2012-05-11 2:08 ` Minchan Kim
2012-05-10 1:39 ` Inki Dae
2012-05-10 4:58 ` Minchan Kim
2012-05-10 6:53 ` KOSAKI Motohiro
2012-05-10 7:27 ` Minchan Kim
2012-05-10 7:31 ` Kyungmin Park
2012-05-10 7:56 ` Minchan Kim
2012-05-10 7:58 ` Minchan Kim
2012-05-10 6:57 ` Inki Dae
2012-05-10 7:05 ` Minchan Kim
2012-05-10 7:59 ` InKi Dae
2012-05-10 8:11 ` Minchan Kim
2012-05-10 8:44 ` Inki Dae
2012-05-10 17:53 ` KOSAKI Motohiro
2012-05-11 0:50 ` Minchan Kim
2012-05-11 2:51 ` KOSAKI Motohiro
2012-05-11 3:01 ` Jerome Glisse
2012-05-11 21:20 ` KOSAKI Motohiro
2012-05-11 22:22 ` Jerome Glisse
2012-05-11 22:59 ` KOSAKI Motohiro
2012-05-11 22:59 ` KOSAKI Motohiro
2012-05-11 23:29 ` Jerome Glisse
2012-05-11 23:39 ` KOSAKI Motohiro
2012-05-12 4:48 ` InKi Dae
2012-05-14 4:29 ` Minchan Kim [this message]
2012-05-14 4:29 ` Minchan Kim
2012-05-14 6:17 ` [PATCH 0/2 v4] " Inki Dae
2012-05-14 6:17 ` [PATCH 1/2 v4] drm/exynos: added userptr limit ioctl Inki Dae
2012-05-14 8:12 ` Inki Dae
2012-05-14 6:17 ` [PATCH 2/2 v4] drm/exynos: added userptr feature Inki Dae
2012-05-14 6:33 ` KOSAKI Motohiro
2012-05-14 6:52 ` Inki Dae
2012-05-14 7:04 ` KOSAKI Motohiro
2012-05-14 7:21 ` Inki Dae
2012-05-14 8:13 ` Inki Dae
2012-05-14 19:26 ` Jerome Glisse
2012-05-15 4:33 ` Inki Dae
2012-05-15 14:31 ` Jerome Glisse
2012-05-16 8:49 ` Inki Dae
2012-05-14 8:12 ` [PATCH 0/2 " Inki Dae
2012-05-15 7:34 ` [PATCH 3/4] " Rob Clark
2012-05-15 8:17 ` Inki Dae
2012-05-15 9:35 ` Rob Clark
2012-05-15 13:40 ` InKi Dae
2012-05-15 14:28 ` Rob Clark
2012-05-16 6:04 ` Inki Dae
2012-05-16 8:42 ` Rob Clark
2012-05-16 10:30 ` Inki Dae
2012-05-16 9:22 ` Dave Airlie
2012-05-16 10:20 ` Inki Dae
2012-05-16 12:12 ` Rob Clark
2012-05-16 13:27 ` Inki Dae
2012-04-23 13:43 ` [PATCH 4/4] drm/exynos: added a feature to get gem buffer information Inki Dae
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=4FB08A27.2040503@kernel.org \
--to=minchan@kernel.org \
--cc=airlied@linux.ie \
--cc=daeinki@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=j.glisse@gmail.com \
--cc=kosaki.motohiro@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-mm@kvack.org \
--cc=sw0312.kim@samsung.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.