Skip to content

Commit 7a14239

Browse files
Hugh Dickinstorvalds
Hugh Dickins
authored andcommitted
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 <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Rik van Riel <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 706874e commit 7a14239

File tree

3 files changed

+9
-65
lines changed

3 files changed

+9
-65
lines changed

Documentation/filesystems/proc.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ manner. The codes are the following:
485485
ac - area is accountable
486486
nr - swap space is not reserved for the area
487487
ht - area uses huge tlb pages
488-
nl - non-linear mapping
489488
ar - architecture specific flag
490489
dd - do not include area into core dump
491490
sd - soft-dirty flag

Documentation/vm/page_migration

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ Steps:
9999
4. The new page is prepped with some settings from the old page so that
100100
accesses to the new page will discover a page with the correct settings.
101101

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.
108106

109107
6. The radix tree lock is taken. This will cause all processes trying
110108
to access the page via the mapping to block on the radix tree spinlock.

Documentation/vm/unevictable-lru.txt

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -552,63 +552,17 @@ different reverse map mechanisms.
552552
is really unevictable or not. In this case, try_to_unmap_anon() will
553553
return SWAP_AGAIN.
554554

555-
(*) try_to_unmap_file() - linear mappings
555+
(*) try_to_unmap_file()
556556

557557
Unmapping of a mapped file page works the same as for anonymous mappings,
558558
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.
562560

563561
As for anonymous pages, on encountering a VM_LOCKED VMA for a mapped file
564562
page, try_to_unmap_file() will attempt to acquire the associated
565563
mm_struct's mmap semaphore to mlock the page, returning SWAP_MLOCK if this
566564
is successful, and SWAP_AGAIN, if not.
567565

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-
612566

613567
try_to_munlock() REVERSE MAP SCAN
614568
---------------------------------
@@ -625,23 +579,16 @@ introduced a variant of try_to_unmap() called try_to_munlock().
625579
try_to_munlock() calls the same functions as try_to_unmap() for anonymous and
626580
mapped file pages with an additional argument specifying unlock versus unmap
627581
processing. Again, these functions walk the respective reverse maps looking
628-
for VM_LOCKED VMAs. When such a VMA is found for anonymous pages and file
629-
pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
630-
attempt to acquire the associated mmap semaphore, mlock the page via
631-
mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
582+
for VM_LOCKED VMAs. When such a VMA is found, as in the try_to_unmap() case,
583+
the functions attempt to acquire the associated mmap semaphore, mlock the page
584+
via mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
632585
pre-clearing of the page's PG_mlocked done by munlock_vma_page.
633586

634587
If try_to_unmap() is unable to acquire a VM_LOCKED VMA's associated mmap
635588
semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() to
636589
recycle the page on the inactive list and hope that it has better luck with the
637590
page next time.
638591

639-
For file pages mapped into non-linear VMAs, the try_to_munlock() logic works
640-
slightly differently. On encountering a VM_LOCKED non-linear VMA that might
641-
map the page, try_to_munlock() returns SWAP_AGAIN without actually mlocking the
642-
page. munlock_vma_page() will just leave the page unlocked and let vmscan deal
643-
with it - the usual fallback position.
644-
645592
Note that try_to_munlock()'s reverse map walk must visit every VMA in a page's
646593
reverse map to determine that a page is NOT mapped into any VM_LOCKED VMA.
647594
However, the scan can terminate when it encounters a VM_LOCKED VMA and can

0 commit comments

Comments
 (0)