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: <20200416221238.qrkaajbe3m6ca2h2@box>
Date:   Fri, 17 Apr 2020 01:12:38 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     Dave Hansen <dave.hansen@...el.com>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH, RFC] x86/mm/pat: Restore large pages after fragmentation

On Thu, Apr 16, 2020 at 03:03:12PM -0700, Dave Hansen wrote:
> On 4/16/20 2:32 PM, Kirill A. Shutemov wrote:
> > With current code it's one way road: kernel tries to avoid splitting
> > large pages, but it doesn't restore them back even if page attributes
> > got compatible again.
> 
> Looks pretty sane to me, and sounds like something we've needed for a
> long time.
> 
> I'd having doubts in my ability to find nasty corner cases in this code,
> though.  Could you rig up some tests to poke at this thing further?  Maybe:
> 
> Record what the direct map looks like (even from userspace).  Then,
> allocate some memory, including odd-sized and aligned ranges.  Try to do
> things >4M like the hugetlbfs code does.  Make the allocation (or a
> piece of it) not-present (or whatever), which usually fractures some
> large pages.  Then put it back the way it was.  All the large pages
> should come back.
> 
> If it survives that for an hour or two, it should be pretty good to go.
>  Basically, fuzz it.

We already have it in kernel: CONFIG_CPA_DEBUG. It messes up with the
mapping every 30 seconds. It is pretty good for the change too. It
produces a lot of 2M/1G pages to be restored. I run it over night in my
setup and it survives.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ