]> git.baikalelectronics.ru Git - kernel.git/commit
mm: split huge PUD on wp_huge_pud fallback
authorGowans, James <jgowans@amazon.com>
Thu, 23 Jun 2022 05:24:03 +0000 (05:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:11 +0000 (21:24 +0200)
commita4409c6bcc1a12ad638ed0d7fa09ae7fbfbb8b4b
treeaaee60fae3174bb92eba62d41852745868db03ce
parentbe1ca30d5aecc92497ac658575b2ca0a2244d73d
mm: split huge PUD on wp_huge_pud fallback

commit 37f8f626ccf79de5f982739259292de115b4ca32 upstream.

Currently the implementation will split the PUD when a fallback is taken
inside the create_huge_pud function.  This isn't where it should be done:
the splitting should be done in wp_huge_pud, just like it's done for PMDs.
Reason being that if a callback is taken during create, there is no PUD
yet so nothing to split, whereas if a fallback is taken when encountering
a write protection fault there is something to split.

It looks like this was the original intention with the commit where the
splitting was introduced, but somehow it got moved to the wrong place
between v1 and v2 of the patch series.  Rebase mistake perhaps.

Link: https://lkml.kernel.org/r/6f48d622eb8bce1ae5dd75327b0b73894a2ec407.camel@amazon.com
Fixes: 0455fd184d33 ("mm: Split huge pages on write-notify or COW")
Signed-off-by: James Gowans <jgowans@amazon.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/memory.c