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/rmap: fix comments left over from recent changes

Parallel developments in mm/rmap.c have left behind some out-of-date
comments: try_to_migrate_one() also accepts TTU_SYNC (already commented
in try_to_migrate() itself), and try_to_migrate() returns nothing at
all.

TTU_SPLIT_FREEZE has just been deleted, so reword the comment about it
in mm/huge_memory.c; and TTU_IGNORE_ACCESS was removed in 5.11, so
delete the "recently referenced" comment from try_to_unmap_one() (once
upon a time the comment was near the removed codeblock, but they drifted
apart).

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Link: https://lore.kernel.org/lkml/563ce5b2-7a44-5b4d-1dfd-59a0e65932a9@google.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
64b586d1 98f7fdce

+2 -7
+1 -1
mm/huge_memory.c
··· 2331 2331 { 2332 2332 int i; 2333 2333 2334 - /* If TTU_SPLIT_FREEZE is ever extended to file, remove this check */ 2334 + /* If unmap_page() uses try_to_migrate() on file, remove this check */ 2335 2335 if (!PageAnon(page)) 2336 2336 return; 2337 2337 if (PageTransHuge(page)) {
+1 -6
mm/rmap.c
··· 1439 1439 while (page_vma_mapped_walk(&pvmw)) { 1440 1440 /* 1441 1441 * If the page is mlock()d, we cannot swap it out. 1442 - * If it's recently referenced (perhaps page_referenced 1443 - * skipped over this mm) then we should reactivate it. 1444 1442 */ 1445 1443 if (!(flags & TTU_IGNORE_MLOCK)) { 1446 1444 if (vma->vm_flags & VM_LOCKED) { ··· 1685 1687 * @arg: enum ttu_flags will be passed to this argument. 1686 1688 * 1687 1689 * If TTU_SPLIT_HUGE_PMD is specified any PMD mappings will be split into PTEs 1688 - * containing migration entries. This and TTU_RMAP_LOCKED are the only supported 1689 - * flags. 1690 + * containing migration entries. 1690 1691 */ 1691 1692 static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, 1692 1693 unsigned long address, void *arg) ··· 1925 1928 * 1926 1929 * Tries to remove all the page table entries which are mapping this page and 1927 1930 * replace them with special swap entries. Caller must hold the page lock. 1928 - * 1929 - * If is successful, return true. Otherwise, false. 1930 1931 */ 1931 1932 void try_to_migrate(struct page *page, enum ttu_flags flags) 1932 1933 {