linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "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>
Cc: 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: Thu, 16 Apr 2020 15:03:12 -0700	[thread overview]
Message-ID: <bf3e6e77-b812-992c-9916-76f19ae5c94a@intel.com> (raw)
In-Reply-To: <20200416213229.19174-1-kirill.shutemov@linux.intel.com>

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.

  reply	other threads:[~2020-04-16 22:03 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 [this message]
2020-04-16 22:12   ` Kirill A. Shutemov
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=bf3e6e77-b812-992c-9916-76f19ae5c94a@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --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).