From: "Kirill A. Shutemov" 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: Mon, 30 Sep 2019 16:03:57 +0300 Message-ID: <20190930130357.ye3zlkbka2jtd56a@box> References: <20190926115548.44000-1-thomas_os@shipmail.org> <20190926115548.44000-2-thomas_os@shipmail.org> <85e31bcf-d3c8-2fcf-e659-2c9f82ebedc7@shipmail.org> <20190927121754.kn46qh2crvsnw5z2@box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds Cc: Thomas =?utf-8?Q?Hellstr=C3=B6m_=28VMware=29?= , Linux Kernel Mailing List , dri-devel , Linux-MM , Andrew Morton , Matthew Wilcox List-Id: dri-devel@lists.freedesktop.org On Fri, Sep 27, 2019 at 09:39:48AM -0700, Linus Torvalds wrote: > On Fri, Sep 27, 2019 at 5:17 AM Kirill A. Shutemov wrote: > > > > > Call it "walk_page_mapping()". And talk extensively about how the > > > locking differs a lot from the usual "walk_page_vma()" things. > > > > Walking mappings of a page is what rmap does. This code thas to be > > integrated there. > > Well, that's very questionable. > > The rmap code mainly does the "page -> virtual" mapping. One page at a time. > > The page walker code does the "virtual -> pte" mapping. Always a whole > range at a time. Have you seen page_vma_mapped_walk()? I made it specifically for rmap code to cover cases when a THP is mapped with PTEs. To me it's not a big stretch to make it cover multiple pages too. > So I think conceptually, mm/memory.c and unmap_mapping_range() is > closest but I don't think it's practical to share code. > > And between mm/pagewalk.c and mm/rmap.c, I think the page walking has > way more of actual practical code sharing, and is also conceptually > closer because most of the code is about walking a range, not looking > up the mapping of one page. I guess it's matter of personal preferences, but page table walkers based on callback always felt wrong to me. -- Kirill A. Shutemov