Repository navigation
Commit 657e303
shmem, thp: respect MADV_{NO,}HUGEPAGE for file mappings
Let's wire up existing madvise() hugepage hints for file mappings.
MADV_HUGEPAGE advise shmem to allocate huge page on page fault in the
VMA. It only has effect if the filesystem is mounted with huge=advise
or huge=within_size.
MADV_NOHUGEPAGE prevents hugepage from being allocated on page fault in
the VMA. It doesn't prevent a huge page from being allocated by other
means, i.e. page fault into different mapping or write(2) into file.
Link: http://lkml.kernel.org/r/1466021202-61880-31-git-send-email-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 800d8c6 commit 657e303
2 files changed
Lines changed: 22 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1830 | 1830 | | |
1831 | 1831 | | |
1832 | 1832 | | |
1833 | | - | |
| 1833 | + | |
1834 | 1834 | | |
1835 | 1835 | | |
1836 | 1836 | | |
| |||
1846 | 1846 | | |
1847 | 1847 | | |
1848 | 1848 | | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | 1849 | | |
1855 | 1850 | | |
1856 | 1851 | | |
1857 | 1852 | | |
1858 | 1853 | | |
1859 | 1854 | | |
1860 | 1855 | | |
1861 | | - | |
| 1856 | + | |
| 1857 | + | |
1862 | 1858 | | |
1863 | 1859 | | |
1864 | 1860 | | |
1865 | | - | |
1866 | | - | |
1867 | | - | |
1868 | | - | |
1869 | | - | |
1870 | 1861 | | |
1871 | 1862 | | |
1872 | 1863 | | |
| |||
1974 | 1965 | | |
1975 | 1966 | | |
1976 | 1967 | | |
1977 | | - | |
| 1968 | + | |
1978 | 1969 | | |
1979 | 1970 | | |
1980 | 1971 | | |
| |||
2366 | 2357 | | |
2367 | 2358 | | |
2368 | 2359 | | |
2369 | | - | |
| 2360 | + | |
2370 | 2361 | | |
2371 | 2362 | | |
2372 | 2363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
1409 | 1411 | | |
1410 | 1412 | | |
1411 | 1413 | | |
| 1414 | + | |
1412 | 1415 | | |
1413 | 1416 | | |
1414 | 1417 | | |
1415 | 1418 | | |
1416 | 1419 | | |
1417 | 1420 | | |
1418 | 1421 | | |
| 1422 | + | |
| 1423 | + | |
1419 | 1424 | | |
1420 | 1425 | | |
1421 | 1426 | | |
| |||
1534 | 1539 | | |
1535 | 1540 | | |
1536 | 1541 | | |
1537 | | - | |
| 1542 | + | |
1538 | 1543 | | |
1539 | 1544 | | |
1540 | 1545 | | |
| |||
1551 | 1556 | | |
1552 | 1557 | | |
1553 | 1558 | | |
1554 | | - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1555 | 1562 | | |
1556 | 1563 | | |
1557 | 1564 | | |
| |||
1680 | 1687 | | |
1681 | 1688 | | |
1682 | 1689 | | |
| 1690 | + | |
1683 | 1691 | | |
1684 | 1692 | | |
1685 | 1693 | | |
| |||
1741 | 1749 | | |
1742 | 1750 | | |
1743 | 1751 | | |
1744 | | - | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
1745 | 1759 | | |
1746 | 1760 | | |
1747 | 1761 | | |
| |||
0 commit comments