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

thp, mlock: update unevictable-lru.txt

Add description of THP handling into unevictable-lru.txt.

Link: http://lkml.kernel.org/r/1466021202-61880-7-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>

authored by

Kirill A. Shutemov and committed by
Linus Torvalds
6fb8ddfc 1f52e67e

+21
+21
Documentation/vm/unevictable-lru.txt
··· 461 461 the page migration code and the same work flow as described in MIGRATING 462 462 MLOCKED PAGES will apply. 463 463 464 + MLOCKING TRANSPARENT HUGE PAGES 465 + ------------------------------- 466 + 467 + A transparent huge page is represented by a single entry on an LRU list. 468 + Therefore, we can only make unevictable an entire compound page, not 469 + individual subpages. 470 + 471 + If a user tries to mlock() part of a huge page, we want the rest of the 472 + page to be reclaimable. 473 + 474 + We cannot just split the page on partial mlock() as split_huge_page() can 475 + fail and new intermittent failure mode for the syscall is undesirable. 476 + 477 + We handle this by keeping PTE-mapped huge pages on normal LRU lists: the 478 + PMD on border of VM_LOCKED VMA will be split into PTE table. 479 + 480 + This way the huge page is accessible for vmscan. Under memory pressure the 481 + page will be split, subpages which belong to VM_LOCKED VMAs will be moved 482 + to unevictable LRU and the rest can be reclaimed. 483 + 484 + See also comment in follow_trans_huge_pmd(). 464 485 465 486 mmap(MAP_LOCKED) SYSTEM CALL HANDLING 466 487 -------------------------------------