提交 64b586d1 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

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: NHugh Dickins <hughd@google.com>
Reviewed-by: NShakeel Butt <shakeelb@google.com>
Reviewed-by: NAlistair 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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 98f7fdce
...@@ -2331,7 +2331,7 @@ static void remap_page(struct page *page, unsigned int nr) ...@@ -2331,7 +2331,7 @@ static void remap_page(struct page *page, unsigned int nr)
{ {
int i; int i;
/* If TTU_SPLIT_FREEZE is ever extended to file, remove this check */ /* If unmap_page() uses try_to_migrate() on file, remove this check */
if (!PageAnon(page)) if (!PageAnon(page))
return; return;
if (PageTransHuge(page)) { if (PageTransHuge(page)) {
......
...@@ -1439,8 +1439,6 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, ...@@ -1439,8 +1439,6 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
while (page_vma_mapped_walk(&pvmw)) { while (page_vma_mapped_walk(&pvmw)) {
/* /*
* If the page is mlock()d, we cannot swap it out. * If the page is mlock()d, we cannot swap it out.
* If it's recently referenced (perhaps page_referenced
* skipped over this mm) then we should reactivate it.
*/ */
if (!(flags & TTU_IGNORE_MLOCK)) { if (!(flags & TTU_IGNORE_MLOCK)) {
if (vma->vm_flags & VM_LOCKED) { if (vma->vm_flags & VM_LOCKED) {
...@@ -1687,8 +1685,7 @@ void try_to_unmap(struct page *page, enum ttu_flags flags) ...@@ -1687,8 +1685,7 @@ void try_to_unmap(struct page *page, enum ttu_flags flags)
* @arg: enum ttu_flags will be passed to this argument. * @arg: enum ttu_flags will be passed to this argument.
* *
* If TTU_SPLIT_HUGE_PMD is specified any PMD mappings will be split into PTEs * If TTU_SPLIT_HUGE_PMD is specified any PMD mappings will be split into PTEs
* containing migration entries. This and TTU_RMAP_LOCKED are the only supported * containing migration entries.
* flags.
*/ */
static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma,
unsigned long address, void *arg) unsigned long address, void *arg)
...@@ -1928,8 +1925,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma, ...@@ -1928,8 +1925,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma,
* *
* Tries to remove all the page table entries which are mapping this page and * Tries to remove all the page table entries which are mapping this page and
* replace them with special swap entries. Caller must hold the page lock. * replace them with special swap entries. Caller must hold the page lock.
*
* If is successful, return true. Otherwise, false.
*/ */
void try_to_migrate(struct page *page, enum ttu_flags flags) void try_to_migrate(struct page *page, enum ttu_flags flags)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册