lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Feb 2022 14:29:09 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Mauricio Faria de Oliveira <mfo@...onical.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 51/75] mm/rmap: Convert try_to_unmap() to take a folio

On Wed, Feb 09, 2022 at 11:24:34AM -0300, Mauricio Faria de Oliveira wrote:
> 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?

Andrew and I need to resolve conflicts between this series and other
patches in his tree.  You don't need to worry about this.

> 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ