Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-10 Thread VMware
On 10/10/19 4:07 AM, Linus Torvalds wrote: On Wed, Oct 9, 2019 at 6:10 PM Thomas Hellström (VMware) wrote: Your original patch does exactly the same! Oh, no. You misread my original patch. Look again. The logic in my original patch was very different. It said that - *if* we have a

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 6:10 PM Thomas Hellström (VMware) wrote: > > Your original patch does exactly the same! Oh, no. You misread my original patch. Look again. The logic in my original patch was very different. It said that - *if* we have a pmd_entry function, then we obviously call that

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
On 10/10/19 1:51 AM, Linus Torvalds wrote: On Wed, Oct 9, 2019 at 3:31 PM Thomas Hellström (VMware) wrote: On 10/9/19 10:20 PM, Linus Torvalds wrote: You *have* to call split_huge_pmd() if you're doing to call the pte_entry() function. End of story. So is it that you want pte_entry() to be

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 4:51 PM Linus Torvalds wrote: > > (a) right now nobody wants the "skip" behavior. You think you'll > eventually want it > > (b) right now, the "return positive value" is actually a horribly > ugly pointless hack, which could be made to be an error value and > cleaned up

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 3:31 PM Thomas Hellström (VMware) wrote: > > On 10/9/19 10:20 PM, Linus Torvalds wrote: > > > > You *have* to call split_huge_pmd() if you're doing to call the > > pte_entry() function. > > > > End of story. > > So is it that you want pte_entry() to be strictly called for

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
On 10/10/19 12:30 AM, Thomas Hellström (VMware) wrote: On 10/9/19 10:20 PM, Linus Torvalds wrote: On Wed, Oct 9, 2019 at 1:06 PM Thomas Hellström (VMware) wrote: On 10/9/19 9:20 PM, Linus Torvalds wrote: Don't you get it? There *is* no PTE level if you didn't split. Hmm, This paragraph makes

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
On 10/9/19 10:20 PM, Linus Torvalds wrote: On Wed, Oct 9, 2019 at 1:06 PM Thomas Hellström (VMware) wrote: On 10/9/19 9:20 PM, Linus Torvalds wrote: Don't you get it? There *is* no PTE level if you didn't split. Hmm, This paragraph makes me think we have very different perceptions about

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 1:06 PM Thomas Hellström (VMware) wrote: > > On 10/9/19 9:20 PM, Linus Torvalds wrote: > > > > Don't you get it? There *is* no PTE level if you didn't split. > > Hmm, This paragraph makes me think we have very different perceptions about > what I'm trying to achieve. It's

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
On 10/9/19 9:20 PM, Linus Torvalds wrote: No. Your logic is garbage. The above code is completely broken. YOU CAN NOT AVOID TRHE SPLIT AND THEN GO ON AT THE PTE LEVEL. Don't you get it? There *is* no PTE level if you didn't split. Hmm, This paragraph makes me think we have very different

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 11:52 AM Thomas Hellstrom wrote: > > Hmm, so we have the following cases we need to handle when returning > from the pmd_entry() handler. No, we really don't. > 1) Huge pmd was handled - Returns 0 and continues. No. That case simply DOES NOT EXIST. The only case that

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Thomas Hellstrom
Hi, On 10/9/19 7:17 PM, Linus Torvalds wrote: > On Wed, Oct 9, 2019 at 10:03 AM Thomas Hellström (VMware) > wrote: >> Nope, it handles the hugepages by ignoring them, since they should be >> read-only, but if pmd_entry() was called with something else than a >> hugepage, then it requests the

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 10:03 AM Thomas Hellström (VMware) wrote: > > Nope, it handles the hugepages by ignoring them, since they should be > read-only, but if pmd_entry() was called with something else than a > hugepage, then it requests the fallback, but never a split. But PAGE_WALK_FALLBACK

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
On 10/9/19 6:21 PM, Linus Torvalds wrote: On Wed, Oct 9, 2019 at 8:27 AM Kirill A. Shutemov wrote: Do we have any current user that expect split_huge_pmd() in this scenario. No. There are no current users of the pmd callback and the pte callback at all, that I could find. But it looks like

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Linus Torvalds
On Wed, Oct 9, 2019 at 8:27 AM Kirill A. Shutemov wrote: > > Do we have any current user that expect split_huge_pmd() in this scenario. No. There are no current users of the pmd callback and the pte callback at all, that I could find. But it looks like the new drm use does want a "I can't

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread VMware
Hi, Kirill. Thanks for reviewing. On 10/9/19 5:27 PM, Kirill A. Shutemov wrote: On Tue, Oct 08, 2019 at 11:15:02AM +0200, Thomas Hellström (VMware) wrote: From: Thomas Hellstrom The pagewalk code was unconditionally splitting transhuge pmds when a pte_entry was present. However ideally we'd

Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-09 Thread Kirill A. Shutemov
On Tue, Oct 08, 2019 at 11:15:02AM +0200, Thomas Hellström (VMware) wrote: > From: Thomas Hellstrom > > The pagewalk code was unconditionally splitting transhuge pmds when a > pte_entry was present. However ideally we'd want to handle transhuge pmds > in the pmd_entry function and ptes in

[PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present

2019-10-08 Thread VMware
From: Thomas Hellstrom The pagewalk code was unconditionally splitting transhuge pmds when a pte_entry was present. However ideally we'd want to handle transhuge pmds in the pmd_entry function and ptes in pte_entry function. So don't split huge pmds when there is a pmd_entry function present,