[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a48a93d2-03e9-40d3-3b4c-a301632d3121@shipmail.org>
Date: Thu, 26 Sep 2019 22:09:13 +0200
From: Thomas Hellström (VMware)
<thomas_os@...pmail.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Linux-MM <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Matthew Wilcox <willy@...radead.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
Hi,
On 9/26/19 9:19 PM, Linus Torvalds wrote:
> On Thu, Sep 26, 2019 at 5:03 AM Thomas Hellström (VMware)
> <thomas_os@...pmail.org> wrote:
>> I wonder if I can get an ack from an mm maintainer to merge this through
>> DRM along with the vmwgfx patches? Andrew? Matthew?
> It would have helped to actually point to the patch itself, instead of
> just quoting the commit message.
>
> Looks like this:
>
> https://lore.kernel.org/lkml/20190926115548.44000-2-thomas_os@shipmail.org/
>
> but why is the code in question not just using the regular page
> walkers. The commit log shows no explanation of what's so special
> about this?
>
> Is the only reason the locking magic? Because if that's the reason,
> then afaik we already have a function for that: it's
> __walk_page_range().
>
> Yes, it's static right now, but that's imho not a reason to duplicate
> all the walking (badly).
>
> Is there some other magic reason that isn't documented?
>
> Linus
There is a discussion around this subject in
https://lore.kernel.org/lkml/20190926115548.44000-1-thomas_os@shipmail.org/
The main point is that there is an assert in pud_trans_huge_lock() that
the mmap_sem is held, and we don't have it. Presumably we should be able
to get away with the i_mmap_lock, but in addition I would have had to
include the walk_as_pte_range() as the walk::pmd_entry anyway, so the
amount of duplicated page walk code isn't that big.
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.
Thanks,
Thomas
Powered by blists - more mailing lists