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

mm Documentation: undoc non-linear vmas

While updating some mm Documentation, I came across a few straggling
references to the non-linear vmas which were happily removed in v4.0.
Delete them.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Rik van Riel <riel@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
7a14239a 706874e9

+9 -65
-1
Documentation/filesystems/proc.txt
··· 485 485 ac - area is accountable 486 486 nr - swap space is not reserved for the area 487 487 ht - area uses huge tlb pages 488 - nl - non-linear mapping 489 488 ar - architecture specific flag 490 489 dd - do not include area into core dump 491 490 sd - soft-dirty flag
+4 -6
Documentation/vm/page_migration
··· 99 99 4. The new page is prepped with some settings from the old page so that 100 100 accesses to the new page will discover a page with the correct settings. 101 101 102 - 5. All the page table references to the page are converted 103 - to migration entries or dropped (nonlinear vmas). 104 - This decrease the mapcount of a page. If the resulting 105 - mapcount is not zero then we do not migrate the page. 106 - All user space processes that attempt to access the page 107 - will now wait on the page lock. 102 + 5. All the page table references to the page are converted to migration 103 + entries. This decreases the mapcount of a page. If the resulting 104 + mapcount is not zero then we do not migrate the page. All user space 105 + processes that attempt to access the page will now wait on the page lock. 108 106 109 107 6. The radix tree lock is taken. This will cause all processes trying 110 108 to access the page via the mapping to block on the radix tree spinlock.
+5 -58
Documentation/vm/unevictable-lru.txt
··· 552 552 is really unevictable or not. In this case, try_to_unmap_anon() will 553 553 return SWAP_AGAIN. 554 554 555 - (*) try_to_unmap_file() - linear mappings 555 + (*) try_to_unmap_file() 556 556 557 557 Unmapping of a mapped file page works the same as for anonymous mappings, 558 558 except that the scan visits all VMAs that map the page's index/page offset 559 - in the page's mapping's reverse map priority search tree. It also visits 560 - each VMA in the page's mapping's non-linear list, if the list is 561 - non-empty. 559 + in the page's mapping's reverse map interval search tree. 562 560 563 561 As for anonymous pages, on encountering a VM_LOCKED VMA for a mapped file 564 562 page, try_to_unmap_file() will attempt to acquire the associated 565 563 mm_struct's mmap semaphore to mlock the page, returning SWAP_MLOCK if this 566 564 is successful, and SWAP_AGAIN, if not. 567 - 568 - (*) try_to_unmap_file() - non-linear mappings 569 - 570 - If a page's mapping contains a non-empty non-linear mapping VMA list, then 571 - try_to_un{map|lock}() must also visit each VMA in that list to determine 572 - whether the page is mapped in a VM_LOCKED VMA. Again, the scan must visit 573 - all VMAs in the non-linear list to ensure that the pages is not/should not 574 - be mlocked. 575 - 576 - If a VM_LOCKED VMA is found in the list, the scan could terminate. 577 - However, there is no easy way to determine whether the page is actually 578 - mapped in a given VMA - either for unmapping or testing whether the 579 - VM_LOCKED VMA actually pins the page. 580 - 581 - try_to_unmap_file() handles non-linear mappings by scanning a certain 582 - number of pages - a "cluster" - in each non-linear VMA associated with the 583 - page's mapping, for each file mapped page that vmscan tries to unmap. If 584 - this happens to unmap the page we're trying to unmap, try_to_unmap() will 585 - notice this on return (page_mapcount(page) will be 0) and return 586 - SWAP_SUCCESS. Otherwise, it will return SWAP_AGAIN, causing vmscan to 587 - recirculate this page. We take advantage of the cluster scan in 588 - try_to_unmap_cluster() as follows: 589 - 590 - For each non-linear VMA, try_to_unmap_cluster() attempts to acquire the 591 - mmap semaphore of the associated mm_struct for read without blocking. 592 - 593 - If this attempt is successful and the VMA is VM_LOCKED, 594 - try_to_unmap_cluster() will retain the mmap semaphore for the scan; 595 - otherwise it drops it here. 596 - 597 - Then, for each page in the cluster, if we're holding the mmap semaphore 598 - for a locked VMA, try_to_unmap_cluster() calls mlock_vma_page() to 599 - mlock the page. This call is a no-op if the page is already locked, 600 - but will mlock any pages in the non-linear mapping that happen to be 601 - unlocked. 602 - 603 - If one of the pages so mlocked is the page passed in to try_to_unmap(), 604 - try_to_unmap_cluster() will return SWAP_MLOCK, rather than the default 605 - SWAP_AGAIN. This will allow vmscan to cull the page, rather than 606 - recirculating it on the inactive list. 607 - 608 - Again, if try_to_unmap_cluster() cannot acquire the VMA's mmap sem, it 609 - returns SWAP_AGAIN, indicating that the page is mapped by a VM_LOCKED 610 - VMA, but couldn't be mlocked. 611 565 612 566 613 567 try_to_munlock() REVERSE MAP SCAN ··· 579 625 try_to_munlock() calls the same functions as try_to_unmap() for anonymous and 580 626 mapped file pages with an additional argument specifying unlock versus unmap 581 627 processing. Again, these functions walk the respective reverse maps looking 582 - for VM_LOCKED VMAs. When such a VMA is found for anonymous pages and file 583 - pages mapped in linear VMAs, as in the try_to_unmap() case, the functions 584 - attempt to acquire the associated mmap semaphore, mlock the page via 585 - mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the 628 + for VM_LOCKED VMAs. When such a VMA is found, as in the try_to_unmap() case, 629 + the functions attempt to acquire the associated mmap semaphore, mlock the page 630 + via mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the 586 631 pre-clearing of the page's PG_mlocked done by munlock_vma_page. 587 632 588 633 If try_to_unmap() is unable to acquire a VM_LOCKED VMA's associated mmap 589 634 semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() to 590 635 recycle the page on the inactive list and hope that it has better luck with the 591 636 page next time. 592 - 593 - For file pages mapped into non-linear VMAs, the try_to_munlock() logic works 594 - slightly differently. On encountering a VM_LOCKED non-linear VMA that might 595 - map the page, try_to_munlock() returns SWAP_AGAIN without actually mlocking the 596 - page. munlock_vma_page() will just leave the page unlocked and let vmscan deal 597 - with it - the usual fallback position. 598 637 599 638 Note that try_to_munlock()'s reverse map walk must visit every VMA in a page's 600 639 reverse map to determine that a page is NOT mapped into any VM_LOCKED VMA.