[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wh=zsXPmSTJJgEgVr4ebgwTQ-wx-P1c7+koJAK-h2f_vQ@mail.gmail.com>
Date: Wed, 9 Oct 2019 09:07:00 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Thomas Hellström (VMware)
<thomas_os@...pmail.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
Thomas Hellstrom <thellstrom@...are.com>,
Matthew Wilcox <willy@...radead.org>,
Will Deacon <will.deacon@....com>,
Peter Zijlstra <peterz@...radead.org>,
Rik van Riel <riel@...riel.com>,
Minchan Kim <minchan@...nel.org>,
Michal Hocko <mhocko@...e.com>,
Huang Ying <ying.huang@...el.com>,
Jérôme Glisse <jglisse@...hat.com>
Subject: Re: [PATCH v4 2/9] mm: pagewalk: Take the pagetable lock in walk_pte_range()
On Wed, Oct 9, 2019 at 8:14 AM Kirill A. Shutemov <kirill@...temov.name> wrote:
>
> If ->pte_entry() fails on the first entry of the page table, pte - 1 will
> point out side the page table.
>
> And the '- 1' is totally unnecessary as we break the loop before pte++ on
> the last iteration.
Good catch. Too much copying the wrong pattern from other sources.
I do wish we didn't have this pattern of "update pte, then do
pte_unmap as long as it's in the same page". Yeah, it avoids a
variable, but still... But it is what it is, and we just need to be
careful.
Linus
Powered by blists - more mailing lists