From: "Christian König" <christian.koenig@amd.com>
To: "Daniel Vetter" <daniel@ffwll.ch>,
"Thomas Hellström (Intel)" <thomas_os@shipmail.org>
Cc: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Intel Graphics Development" <intel-gfx@lists.freedesktop.org>,
"Matthew Wilcox" <willy@infradead.org>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>,
"Jason Gunthorpe" <jgg@ziepe.ca>,
"John Stultz" <john.stultz@linaro.org>,
"DRI Development" <dri-devel@lists.freedesktop.org>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"open list:DMA BUFFER SHARING FRAMEWORK"
<linux-media@vger.kernel.org>
Subject: Re: [Linaro-mm-sig] [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap
Date: Fri, 12 Mar 2021 08:51:48 +0100 [thread overview]
Message-ID: <c96145e3-1386-8a50-2ee6-6af61a60c861@amd.com> (raw)
In-Reply-To: <CAKMK7uEzGKUc27xdWTv7KPESsyg1kCYCmVxP3b-HrzNCNO5x7g@mail.gmail.com>
Am 11.03.21 um 14:17 schrieb Daniel Vetter:
> [SNIP]
>>>> So I did the following quick experiment on vmwgfx, and it turns out that
>>>> with it,
>>>> fast gup never succeeds. Without the "| PFN_MAP", it typically succeeds
>>>>
>>>> I should probably craft an RFC formalizing this.
>>> Yeah I think that would be good. Maybe even more formalized if we also
>>> switch over to VM_PFNMAP, since afaiui these pte flags here only stop the
>>> fast gup path. And slow gup can still peak through VM_MIXEDMAP. Or
>>> something like that.
>>>
>>> Otoh your description of when it only sometimes succeeds would indicate my
>>> understanding of VM_PFNMAP vs VM_MIXEDMAP is wrong here.
>> My understanding from reading the vmf_insert_mixed() code is that iff
>> the arch has pte_special(), VM_MIXEDMAP should be harmless. But that's
>> not consistent with the vm_normal_page() doc. For architectures without
>> pte_special, VM_PFNMAP must be used, and then we must also block COW
>> mappings.
>>
>> If we can get someone can commit to verify that the potential PAT WC
>> performance issue is gone with PFNMAP, I can put together a series with
>> that included.
> Iirc when I checked there's not much archs without pte_special, so I
> guess that's why we luck out. Hopefully.
I still need to read up a bit on what you guys are discussing here, but
it starts to make a picture. Especially my understanding of what
VM_MIXEDMAP means seems to have been slightly of.
I would say just go ahead and provide patches to always use VM_PFNMAP in
TTM and we can test it and see if there are still some issues.
>> As for existing userspace using COW TTM mappings, I once had a couple of
>> test cases to verify that it actually worked, in particular together
>> with huge PMDs and PUDs where breaking COW would imply splitting those,
>> but I can't think of anything else actually wanting to do that other
>> than by mistake.
> Yeah disallowing MAP_PRIVATE mappings would be another good thing to
> lock down. Really doesn't make much sense.
Completely agree. That sounds like something we should try to avoid.
Regards,
Christian.
> -Daniel
>
next prev parent reply other threads:[~2021-03-12 7:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 10:59 [PATCH 1/2] dma-buf: Require VM_PFNMAP vma for mmap Daniel Vetter
2021-02-24 7:46 ` [Linaro-mm-sig] " Thomas Hellström (Intel)
2021-02-24 8:45 ` Daniel Vetter
2021-02-24 9:15 ` Thomas Hellström (Intel)
2021-02-24 9:31 ` Daniel Vetter
2021-02-25 10:28 ` Christian König
2021-02-25 10:44 ` Daniel Vetter
2021-02-25 15:49 ` Daniel Vetter
2021-02-25 16:53 ` Christian König
2021-02-26 9:41 ` Thomas Hellström (Intel)
2021-02-26 13:28 ` Daniel Vetter
2021-02-27 8:06 ` Thomas Hellström (Intel)
2021-03-01 8:28 ` Daniel Vetter
2021-03-01 8:39 ` Thomas Hellström (Intel)
2021-03-01 9:05 ` Daniel Vetter
2021-03-01 9:21 ` Thomas Hellström (Intel)
2021-03-01 10:17 ` Christian König
2021-03-01 14:09 ` Daniel Vetter
2021-03-11 10:22 ` Thomas Hellström (Intel)
2021-03-11 13:00 ` Daniel Vetter
2021-03-11 13:12 ` Thomas Hellström (Intel)
2021-03-11 13:17 ` Daniel Vetter
2021-03-11 15:37 ` Thomas Hellström (Intel)
2021-03-12 7:51 ` Christian König [this message]
2021-02-24 18:46 ` Jason Gunthorpe
2021-02-25 10:30 ` Christian König
2021-02-25 10:45 ` Daniel Vetter
2021-02-26 3:57 ` John Stultz
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=c96145e3-1386-8a50-2ee6-6af61a60c861@amd.com \
--to=christian.koenig@amd.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jgg@ziepe.ca \
--cc=john.stultz@linaro.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=surenb@google.com \
--cc=thomas_os@shipmail.org \
--cc=willy@infradead.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