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] [day] [month] [year] [list]
Message-Id: <20230418152109.32a90ebecc905ae60e2d072f@linux-foundation.org>
Date:   Tue, 18 Apr 2023 15:21:09 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Vishal Moola <vishal.moola@...il.com>,
        Peng Zhang <zhangpeng362@...wei.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, mike.kravetz@...cle.com,
        sidhartha.kumar@...cle.com, muchun.song@...ux.dev,
        wangkefeng.wang@...wei.com, sunnanyong@...wei.com
Subject: Re: [PATCH v5 3/6] userfaultfd: convert copy_huge_page_from_user()
 to copy_folio_from_user()

On Tue, 11 Apr 2023 04:40:17 +0100 Matthew Wilcox <willy@...radead.org> wrote:

> On Thu, Apr 06, 2023 at 07:28:44PM -0700, Vishal Moola wrote:
> > > -               flush_dcache_page(subpage);
> > > -
> > >                 cond_resched();
> > >         }
> > > +       flush_dcache_folio(dst_folio);
> > >         return ret_val;
> > >  }
> > 
> > Moving the flush_dcache_page() outside the loop to be
> > flush_dcache_folio() changes the behavior of the function.
> > 
> > Initially, if it fails to copy the entire page, the function breaks out
> > of the loop and returns the number of unwritten bytes without
> > flushing the page from the cache. Now if it fails, it will still flush
> > out the page it failed on, as well as any later pages it may not
> > have gotten to yet.
> 
> I'm not sure this is worth worrying about.  Failing to copy the entire
> folio is unlikely, and if we do, flushing the entire folio instead of just
> a few pages in it is harmless.  Plus I have patches which significantly
> optiise flush_dcache_folio() over flush_dcache_page() (for the majority
> of architectures) and so I think this change is actually beneficial in
> the long term.

Thanks, I'll send the series in for the next merge window as-is.  If
others remain unhappy with the flushing issue, please propose something
during the next -rc cycle.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ