lkml.org 
[lkml]   [2022]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 51/75] mm/rmap: Convert try_to_unmap() to take a folio
Hi Andrew and Matthew,

On Fri, Feb 4, 2022 at 5:00 PM Matthew Wilcox (Oracle)
<willy@infradead.org> wrote:
>
> Change both callers and the worker function try_to_unmap_one().
...
> diff --git a/mm/rmap.c b/mm/rmap.c
...
> @@ -1598,8 +1602,8 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> }
>
> /* MADV_FREE page check */
> - if (!PageSwapBacked(page)) {
> - if (!PageDirty(page)) {
> + if (!folio_test_swapbacked(folio)) {
> + if (!folio_test_dirty(folio)) {
> /* Invalidate as we cleared the pte */
> mmu_notifier_invalidate_range(mm,
> address, address + PAGE_SIZE);
> @@ -1608,11 +1612,11 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> }
>
> /*
> - * If the page was redirtied, it cannot be
> + * If the folio was redirtied, it cannot be
> * discarded. Remap the page to page table.
> */
> set_pte_at(mm, address, pvmw.pte, pteval);
> - SetPageSwapBacked(page);
> + folio_set_swapbacked(folio);
> ret = false;
> page_vma_mapped_walk_done(&pvmw);
> break;
...

This conflicts with patch [1], currently in mmotm, and I'll send
another version anyway.
Should that patch be on top of these folio changes, or the other way around?

The latter would help w/ the stable backports that don't have folios
yet, but I can
send backports there as well; not a problem.

Thanks,

[1] https://lkml.kernel.org/r/20220131230255.789059-1-mfo@canonical.com
[PATCH v3] mm: fix race between MADV_FREE reclaim and blkdev direct IO read

--
Mauricio Faria de Oliveira

\
 
 \ /
  Last update: 2022-02-09 15:25    [W:0.847 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site