From: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Linux-MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>
Subject: Re: Ack to merge through DRM? WAS Re: [PATCH v2 1/5] mm: Add write-protect and clean utilities for address space ranges
Date: Wed, 2 Oct 2019 15:28:10 +0200 [thread overview]
Message-ID: <b574e08e-70ce-2cce-03d9-0052bb3f9f87@shipmail.org> (raw)
In-Reply-To: <20191002131819.asjr2tsx6lcmmbof@box>
On 10/2/19 3:18 PM, Kirill A. Shutemov wrote:
> On Wed, Oct 02, 2019 at 11:21:01AM +0200, Thomas Hellström (VMware) wrote:
>> On 9/26/19 10:16 PM, Linus Torvalds wrote:
>>> On Thu, Sep 26, 2019 at 1:09 PM Thomas Hellström (VMware)
>>> <thomas_os@shipmail.org> wrote:
>>>> That said, if people are OK with me modifying the assert in
>>>> pud_trans_huge_lock() and make __walk_page_range non-static, it should
>>>> probably be possible to make it work, yes.
>>> I don't think you need to modify that assert at all.
>>>
>>> That thing only exists when there's a "pud_entry" op in the walker,
>>> and then you absolutely need to have that mmap_lock.
>>>
>>> As far as I can tell, you fundamentally only ever work on a pte level
>>> in your address space walker already and actually have a WARN_ON() on
>>> the pud_huge thing, so no pud entry can possibly apply.
>>>
>>> So no, the assert in pud_trans_huge_lock() does not seem to be a
>>> reason not to just use the existing page table walkers.
>>>
>>> And once you get rid of the walking, what is left? Just the "iterate
>>> over the inode mappings" part. Which could just be done in
>>> mm/pagewalk.c, and then you don't even need to remove the static.
>>>
>>> So making it be just another walking in pagewalk.c would seem to be
>>> the simplest model.
>>>
>>> Call it "walk_page_mapping()". And talk extensively about how the
>>> locking differs a lot from the usual "walk_page_vma()" things.
>>>
>>> The then actual "apply" functions (what a horrid name) could be in the
>>> users. They shouldn't be mixed in with the walking functions anyway.
>>> They are callbacks, not walkers.
>>>
>>> Linus
>> Linus, Kirill
>>
>> I've pushed a reworked version based on the pagewalk code here:
>>
>> https://cgit.freedesktop.org/~thomash/linux/log/?h=pagewalk
>>
>> (top three patched)
>>
>> with users included here:
>>
>> https://cgit.freedesktop.org/~thomash/linux/log/?h=coherent-rebased
>>
>> Do you think this could work? The reason that the "mm: Add write-protect and
>> clean.." code is still in mm as a set of helpers, is of course that much of
>> the needed functionality is not exported, presumably since we want to keep
>> page table manipulation in mm.
> Could you post it to the mailing list? It's easier to review this way.
>
Sure.
/Thomas
next prev parent reply other threads:[~2019-10-02 13:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 11:55 [PATCH v2 0/5] Emulated coherent graphics memory take 2 Thomas Hellström (VMware)
2019-09-26 11:55 ` [PATCH v2 1/5] mm: Add write-protect and clean utilities for address space ranges Thomas Hellström (VMware)
2019-09-26 12:03 ` Ack to merge through DRM? WAS " Thomas Hellström (VMware)
2019-09-26 19:19 ` Linus Torvalds
2019-09-26 20:09 ` Thomas Hellström (VMware)
2019-09-26 20:16 ` Linus Torvalds
2019-09-26 20:55 ` Thomas Hellström (VMware)
2019-09-26 22:20 ` Linus Torvalds
2019-09-27 5:55 ` Thomas Hellström (VMware)
2019-09-27 9:27 ` Thomas Hellström (VMware)
2019-09-27 12:26 ` Kirill A. Shutemov
2019-09-27 12:17 ` Kirill A. Shutemov
2019-09-27 16:39 ` Linus Torvalds
2019-09-30 13:03 ` Kirill A. Shutemov
2019-09-30 17:12 ` Linus Torvalds
2019-09-30 17:38 ` Thomas Hellström (VMware)
2019-10-02 9:21 ` Thomas Hellström (VMware)
2019-10-02 13:18 ` Kirill A. Shutemov
2019-10-02 13:28 ` Thomas Hellström (VMware) [this message]
2019-09-26 11:55 ` [PATCH v2 2/5] drm/vmwgfx: Implement an infrastructure for write-coherent resources Thomas Hellström (VMware)
2019-09-26 11:55 ` [PATCH v2 3/5] drm/vmwgfx: Use an RBtree instead of linked list for MOB resources Thomas Hellström (VMware)
2019-09-26 11:55 ` [PATCH v2 4/5] drm/vmwgfx: Implement an infrastructure for read-coherent resources Thomas Hellström (VMware)
2019-09-26 11:55 ` [PATCH v2 5/5] drm/vmwgfx: Add surface dirty-tracking callbacks Thomas Hellström (VMware)
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=b574e08e-70ce-2cce-03d9-0052bb3f9f87@shipmail.org \
--to=thomas_os@shipmail.org \
--cc=akpm@linux-foundation.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).