From: Hillf Danton <hdanton@sina.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
David Hildenbrand <david@redhat.com>,
Sanan Hasanov <sanan.hasanov@knights.ucf.edu>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzkaller@googlegroups.com" <syzkaller@googlegroups.com>,
Huang Ying <ying.huang@intel.com>
Subject: Re: kernel BUG in page_add_anon_rmap
Date: Tue, 31 Jan 2023 09:16:46 +0800 [thread overview]
Message-ID: <20230131011646.167-1-hdanton@sina.com> (raw)
In-Reply-To: <Y9fsTqMPzi9EIUKH@casper.infradead.org>
On Mon, 30 Jan 2023 16:11:58 +0000 Matthew Wilcox <willy@infradead.org>
> On Sat, Jan 28, 2023 at 10:49:31PM -0800, Hugh Dickins wrote:
> > I guess it will turn out not to be relevant to this particular syzbug,
> > but what do we expect an mbind() of just 0x1000 of a THP to do?
> >
> > It's a subject I've wrestled with unsuccessfully in the past: I found
> > myself arriving at one conclusion (split THP) in one place, and a contrary
> > conclusion (widen range) in another place, and never had time to work out
> > one unified answer.
> >
> > So I do wonder what pte replaces the migration entry when the bug here
> > is fixed: is it a pte pointing into the THP as before, in which case
> > what was the point of "migration"? is it a Copy-On-Bind page?
> > or has the whole THP been migrated?
>
> I have an Opinion!
>
> The important thing about THP (IMO) is the Transparency part.
> Applications don't need to do anything special to get memory managed
> in larger chunks, the only difference is in performance. That is, they
> get better performance if the kernel can do it, and thinks it worthwhile.
>
> The tradeoff with THP is that we treat all memory in this 2MB chunk the
> same way; we track its dirtiness and age as a single thing (position
> on LRU, etc). That assumes we're doing no harm, or less harm than we
> would be tracking each page independently.
>
> If userspace gives us a hint like "I want this range of memory on that
> node", that's a strong signal that *this* range of memory is considered
> by userspace to be a single unit. So my opinion is that userspace is
> letting us know that we previously made a bad decision and we should
> rectify it by splitting now.
Apart from MADV_HUGEPAGE, what do you need wrt tracking THP and splitting it?
next prev parent reply other threads:[~2023-01-31 1:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 23:59 Sanan Hasanov
2023-01-26 0:13 ` Andrew Morton
2023-01-26 18:57 ` Matthew Wilcox
2023-01-26 19:00 ` Sanan Hasanov
2023-01-27 11:44 ` David Hildenbrand
2023-01-27 17:02 ` Hugh Dickins
2023-01-29 6:49 ` Hugh Dickins
2023-01-30 9:03 ` David Hildenbrand
2023-01-30 9:26 ` David Hildenbrand
2023-01-30 16:11 ` Matthew Wilcox
2023-01-31 1:16 ` Hillf Danton [this message]
2023-01-30 19:20 ` Yang Shi
2023-01-30 19:26 ` Liam R. Howlett
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=20230131011646.167-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sanan.hasanov@knights.ucf.edu \
--cc=syzkaller@googlegroups.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/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