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:   Thu, 26 Nov 2020 20:07:03 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Hugh Dickins <hughd@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, Jan Kara <jack@...e.cz>,
        William Kucharski <william.kucharski@...cle.com>,
        Linux-FSDevel <linux-fsdevel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>, Christoph Hellwig <hch@....de>,
        Johannes Weiner <hannes@...xchg.org>,
        Yang Shi <yang.shi@...ux.alibaba.com>, dchinner@...hat.com,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 00/16] Overhaul multi-page lookups for THP

On Thu, Nov 26, 2020 at 11:24:59AM -0800, Hugh Dickins wrote:
> On Thu, 26 Nov 2020, Matthew Wilcox wrote:
> > On Wed, Nov 25, 2020 at 04:11:57PM -0800, Hugh Dickins wrote:
> > > > +                               index = truncate_inode_partial_page(mapping,
> > > > +                                               page, lstart, lend);
> > > > +                               if (index > end)
> > > > +                                       end = indices[i] - 1;
> > > >                         }
> > > > -                       unlock_page(page);
> > > 
> > > The fix needed is here: instead of deleting that unlock_page(page)
> > > line, it needs to be } else { unlock_page(page); }
> > 
> > It also needs a put_page(page);
> 
> Oh yes indeed, sorry for getting that wrong.  I'd misread the
> pagevec_reinit() at the end as the old pagevec_release().  Do you
> really need to do pagevec_remove_exceptionals() there if you're not
> using pagevec_release()?

Oh, good point!

> > That's now taken care of by truncate_inode_partial_page(), so if we're
> > not calling that, we need to put the page as well.  ie this:
> 
> Right, but I do find it confusing that truncate_inode_partial_page()
> does the unlock_page(),put_page() whereas truncate_inode_page() does
> not: I think you would do better to leave them out of _partial_page(),
> even if including them there saves a couple of lines somewhere else.

I agree; I don't love it.  The only reason I moved them in there was
because after calling split_huge_page(), we have to call unlock_page();
put_page(); on the former-tail-page-that-is-now-partial, not on the
head page.

Hm, what I could do is return the struct page which is now the partial
page.  Why do I never think of these things before posting?  I'll see
how that works out.

> But right now it's the right fix that's important: ack to yours below.
> 
> I've not yet worked out the other issues I saw: will report when I have.
> Rebooted this laptop, pretty sure it missed freeing a shmem swap entry,
> not yet reproduced, will study the change there later, but the non-swap 
> hang in generic/476 (later seen also in generic/112) more important.

The good news is that I've sorted out the SCRATCH_DEV issue with
running xfstests.  The bad news is that (even on an unmodified kernel),
generic/027 takes 19 hours to run.  On xfs, it's 4 minutes.  Any idea
why it's so slow on tmpfs?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ