Skip to content

Commit 3e8715f

Browse files
kiryltorvalds
authored andcommitted
mm: drop zap_details::check_swap_entries
detail == NULL would give the same functionality as .check_swap_entries==true. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent da162e9 commit 3e8715f

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

include/linux/mm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ struct zap_details {
11751175
struct address_space *check_mapping; /* Check page->mapping if set */
11761176
pgoff_t first_index; /* Lowest page->index to unmap */
11771177
pgoff_t last_index; /* Highest page->index to unmap */
1178-
bool check_swap_entries; /* Check also swap entries */
11791178
};
11801179

11811180
struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr,

mm/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,8 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
11731173
}
11741174
continue;
11751175
}
1176-
/* only check swap_entries if explicitly asked for in details */
1177-
if (unlikely(details && !details->check_swap_entries))
1176+
/* If details->check_mapping, we leave swap entries. */
1177+
if (unlikely(details))
11781178
continue;
11791179

11801180
entry = pte_to_swp_entry(ptent);

mm/oom_kill.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
465465
{
466466
struct mmu_gather tlb;
467467
struct vm_area_struct *vma;
468-
struct zap_details details = {.check_swap_entries = true};
469468
bool ret = true;
470469

471470
/*
@@ -531,7 +530,7 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
531530
*/
532531
if (vma_is_anonymous(vma) || !(vma->vm_flags & VM_SHARED))
533532
unmap_page_range(&tlb, vma, vma->vm_start, vma->vm_end,
534-
&details);
533+
NULL);
535534
}
536535
tlb_finish_mmu(&tlb, 0, -1);
537536
pr_info("oom_reaper: reaped process %d (%s), now anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n",

0 commit comments

Comments
 (0)