lkml.org 
[lkml]   [2022]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm/madvise: fix madvise_pageout for private file mappings
From
> +	 * If the VMA belongs to a private file mapping, there can be private
> + * dirty pages which can be paged out if even this process is neither
> + * owner nor write capable of the file. Cache the file access check
> + * here and use it later during page walk.
> + */
> + can_pageout_file = can_do_file_pageout(vma);

Why not move that into madvise_pageout_page_range() ? Avoids passing
this variable to that function.

In fact, why not even call that function directly instead of storing
that in madvise_walk_private(). The function is extremely lightweight.

>
> lru_add_drain();
> tlb_gather_mmu(&tlb, mm);
> - madvise_pageout_page_range(&tlb, vma, start_addr, end_addr);
> + madvise_pageout_page_range(&tlb, vma, start_addr, end_addr, can_pageout_file);
> tlb_finish_mmu(&tlb);
>
> return 0;

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2022-12-01 14:05    [W:0.359 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site