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]
Message-ID: <20180104113451.j7dwal6mxbelt4p4@techsingularity.net>
Date:   Thu, 4 Jan 2018 11:34:51 +0000
From:   Mel Gorman <mgorman@...hsingularity.net>
To:     "??????(Caspar)" <jinli.zjl@...baba-inc.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, green@...uxhacker.ru,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        "??????(??????)" <zhiche.yy@...baba-inc.com>,
        ?????? <shidao.ytt@...baba-inc.com>
Subject: Re: [PATCH] mm/fadvise: discard partial pages iff endbyte is also eof

On Thu, Jan 04, 2018 at 02:13:43PM +0800, ??????(Caspar) wrote:
> 
> 
> On 2018/1/3 18:48, Mel Gorman wrote:
> > On Wed, Jan 03, 2018 at 02:53:43PM +0800, ??????(Caspar) wrote:
> > > 
> > > 
> > > > ?? 2017??12??23????12:16?????? <shidao.ytt@...baba-inc.com> ??????
> > > > 
> > > > From: "shidao.ytt" <shidao.ytt@...baba-inc.com>
> > > > 
> > > > in commit 441c228f817f7 ("mm: fadvise: document the
> > > > fadvise(FADV_DONTNEED) behaviour for partial pages") Mel Gorman
> > > > explained why partial pages should be preserved instead of discarded
> > > > when using fadvise(FADV_DONTNEED), however the actual codes to calcuate
> > > > end_index was unexpectedly wrong, the code behavior didn't match to the
> > > > statement in comments; Luckily in another commit 18aba41cbf
> > > > ("mm/fadvise.c: do not discard partial pages with POSIX_FADV_DONTNEED")
> > > > Oleg Drokin fixed this behavior
> > > > 
> > > > Here I come up with a new idea that actually we can still discard the
> > > > last parital page iff the page-unaligned endbyte is also the end of
> > > > file, since no one else will use the rest of the page and it should be
> > > > safe enough to discard.
> > > 
> > > +akpm...
> > > 
> > > Hi Mel, Andrew:
> > > 
> > > Would you please take a look at this patch, to see if this proposal
> > > is reasonable enough, thanks in advance!
> > > 
> > 
> > I'm backlogged after being out for the Christmas. Superficially the patch
> > looks ok but I wondered how often it happened in practice as we already
> > would discard files smaller than a page on DONTNEED. It also requires
> 
> Actually, we would *not*. Let's look into the codes.
> 

You're right of course. I suggest updating the changelog with what you
found and the test case. I think it's reasonable to special case the
discarding of partial pages if it's the end of a file with the potential
addendum of checking if the endbyte is past the end of the file. The man
page should also be updated.

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ