From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Dave Hansen <dave.hansen@intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH, RFC] x86/mm/pat: Restore large pages after fragmentation
Date: Fri, 17 Apr 2020 01:12:38 +0300 [thread overview]
Message-ID: <20200416221238.qrkaajbe3m6ca2h2@box> (raw)
In-Reply-To: <bf3e6e77-b812-992c-9916-76f19ae5c94a@intel.com>
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
next prev parent reply other threads:[~2020-04-16 22:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 21:32 [PATCH, RFC] x86/mm/pat: Restore large pages after fragmentation Kirill A. Shutemov
2020-04-16 22:03 ` Dave Hansen
2020-04-16 22:12 ` Kirill A. Shutemov [this message]
2020-04-16 22:38 ` Dave Hansen
2020-04-17 0:52 ` Mika Penttilä
2020-04-17 11:42 ` Kirill A. Shutemov
2020-04-17 12:05 ` Mika Penttilä
2020-04-17 12:18 ` Peter Zijlstra
2020-04-17 14:42 ` Kirill A. Shutemov
2020-04-17 15:17 ` Peter Zijlstra
2020-04-17 15:47 ` Peter Zijlstra
2020-04-17 16:54 ` Kirill A. Shutemov
2020-04-25 11:43 ` [x86/mm/pat] ae64ac1a83: BUG:Bad_page_state_in_process kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200416221238.qrkaajbe3m6ca2h2@box \
--to=kirill@shutemov.name \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).