[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAO9xwp2+3Sh-X8xcukLxp5NE3pLWTx=KqVhivDB33W1Xci7uHQ@mail.gmail.com>
Date: Wed, 9 Feb 2022 11:24:34 -0300
From: Mauricio Faria de Oliveira <mfo@...onical.com>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [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@...radead.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
Powered by blists - more mailing lists