Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: thp: Return the correct value for change_huge_pmd

The wrong value is being returned by change_huge_pmd since commit
10c1045f28e8 ("mm: numa: avoid unnecessary TLB flushes when setting
NUMA hinting entries") which allows a fallthrough that tries to adjust
non-existent PTEs. This patch corrects it.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mel Gorman and committed by
Linus Torvalds
ba68bc01 09d35919

+2 -2
+2 -2
mm/huge_memory.c
··· 1487 1487 1488 1488 if (__pmd_trans_huge_lock(pmd, vma, &ptl) == 1) { 1489 1489 pmd_t entry; 1490 + ret = 1; 1490 1491 1491 1492 /* 1492 1493 * Avoid trapping faults against the zero page. The read-only ··· 1496 1495 */ 1497 1496 if (prot_numa && is_huge_zero_pmd(*pmd)) { 1498 1497 spin_unlock(ptl); 1499 - return 0; 1498 + return ret; 1500 1499 } 1501 1500 1502 1501 if (!prot_numa || !pmd_protnone(*pmd)) { 1503 - ret = 1; 1504 1502 entry = pmdp_get_and_clear_notify(mm, addr, pmd); 1505 1503 entry = pmd_modify(entry, newprot); 1506 1504 ret = HPAGE_PMD_NR;