linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: 'KOSAKI Motohiro' <kosaki.motohiro@gmail.com>
Cc: linux-mm@kvack.org, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, j.glisse@gmail.com,
	minchan@kernel.org, kyungmin.park@samsung.com,
	sw0312.kim@samsung.com, jy0922.shim@samsung.com
Subject: RE: [PATCH 2/2 v4] drm/exynos: added userptr feature.
Date: Mon, 14 May 2012 17:13:29 +0900	[thread overview]
Message-ID: <003601cd31a9$71c2d380$55487a80$%dae@samsung.com> (raw)
In-Reply-To: <4FB0AE87.60800@gmail.com>

ccing linux-mm

> -----Original Message-----
> From: KOSAKI Motohiro [mailto:kosaki.motohiro@gmail.com]
> Sent: Monday, May 14, 2012 4:05 PM
> To: Inki Dae
> Cc: 'KOSAKI Motohiro'; airlied@linux.ie; dri-devel@lists.freedesktop.org;
> j.glisse@gmail.com; minchan@kernel.org; kyungmin.park@samsung.com;
> sw0312.kim@samsung.com; jy0922.shim@samsung.com
> Subject: Re: [PATCH 2/2 v4] drm/exynos: added userptr feature.
> 
> (5/14/12 2:52 AM), Inki Dae wrote:
> >
> >
> >> -----Original Message-----
> >> From: KOSAKI Motohiro [mailto:kosaki.motohiro@gmail.com]
> >> Sent: Monday, May 14, 2012 3:33 PM
> >> To: Inki Dae
> >> Cc: airlied@linux.ie; dri-devel@lists.freedesktop.org;
> j.glisse@gmail.com;
> >> minchan@kernel.org; kyungmin.park@samsung.com; sw0312.kim@samsung.com;
> >> jy0922.shim@samsung.com
> >> Subject: Re: [PATCH 2/2 v4] drm/exynos: added userptr feature.
> >>
> >>> +       npages = buf->size>>  PAGE_SHIFT;
> >>
> >> Why round down? usually we use round up.
> >>
> >
> > The size was already rounded up by exynos_drm_gem_userptr_ioctl so this
> is
> > just used to get page count.
> 
> got it.
> 
> 
> 
> >>> +       down_read(&current->mm->mmap_sem);
> >>> +
> >>> +       /*
> >>> +        * Basically, all the pages from get_user_pages() can not be
not
> >> only
> >>> +        * migrated by CMA but also swapped out.
> >>> +        *
> >>> +        * The migration issue.
> >>> +        * - Pages reserved by CMA for some device using DMA could be
> >> used by
> >>> +        * kernel and if the device driver wants to use those pages
> >>> +        * while being used by kernel then the pages are copied into
> >>> +        * other ones allocated to migrate them and then finally,
> >>> +        * the device driver can use the pages for itself.
> >>> +        * Thus, migrated, the pages being accessed by DMA could be
> >> changed
> >>> +        * to other so this situation may incur that DMA accesses any
> >> pages
> >>> +        * it doesn't want.
> >>> +        *
> >>> +        * But the use of get_user_pages is safe from such magration
> >> issue
> >>> +        * because all the pages from get_user_pages CAN NOT be not
only
> >>> +        * migrated, but also swapped out.
> >>> +        */
> >>> +       get_npages = get_user_pages(current, current->mm, userptr,
> >>> +                                       npages, write, 1, buf->pages,
> > NULL);
> >>
> >> Why force=1? It is almostly core-dump specific option. Why don't you
> >> return
> >
> > I know that force indicates whether to force write access even  if user
> > mapping is readonly.
> 
> right. and then, usually we don't want to ignore access permission. but
> note,
> I'm only talk about generic thing. I have no knowledge drm area.
> 
> 
> 
> > so we just want to use pages from get_user_pages as
> > read/write permission.
> 
> >> EFAULT when the page has write permission. IOW, Why your Xorg module
> >> don't map memory w/ PROT_WRITE?
> >
> > No, Xorg can map memory w/ PROT_WRITE. Couldn't the Xorg map w/
> PROT_WRITE
> > if force = 1? plz, let me know if there is my missing point.
> 
> I meant, if Xorg always use PROT_WRITE, you don't need force=1.
> 


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

  parent reply	other threads:[~2012-05-14  8:13 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1335188594-17454-4-git-send-email-inki.dae@samsung.com>
     [not found] ` <1336544259-17222-1-git-send-email-inki.dae@samsung.com>
     [not found]   ` <1336544259-17222-3-git-send-email-inki.dae@samsung.com>
2012-05-09 14:45     ` [PATCH 2/2 v3] " 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: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 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
     [not found]   ` <1336976268-14328-1-git-send-email-inki.dae@samsung.com>
2012-05-14  8:12     ` [PATCH 0/2 v4] " Inki Dae
     [not found]     ` <1336976268-14328-2-git-send-email-inki.dae@samsung.com>
2012-05-14  8:12       ` [PATCH 1/2 v4] drm/exynos: added userptr limit ioctl Inki Dae
     [not found]     ` <1336976268-14328-3-git-send-email-inki.dae@samsung.com>
     [not found]       ` <CAHGf_=qv45_uuO_JWMXOQp4VymyOxVq76rGXghoNMmDh7mURKQ@mail.gmail.com>
     [not found]         ` <003001cd319e$263c9230$72b5b690$%dae@samsung.com>
     [not found]           ` <4FB0AE87.60800@gmail.com>
2012-05-14  8:13             ` Inki Dae [this message]
     [not found]       ` <CAH3drwb13T2RXgEuauGchoZUDAgL+wrv3SR66sZNyGk_6tRTFw@mail.gmail.com>
2012-05-15  4:33         ` [PATCH 2/2 v4] drm/exynos: added userptr feature Inki Dae
2012-05-15 14:31           ` Jerome Glisse
2012-05-16  8:49             ` 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='003601cd31a9$71c2d380$55487a80$%dae@samsung.com' \
    --to=inki.dae@samsung.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.glisse@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox