From: Lance Yang <ioworker0@gmail.com>
To: Michal Hocko <mhocko@suse.com>
Cc: akpm@linux-foundation.org, zokeefe@google.com, david@redhat.com,
songmuchun@bytedance.com, shy828301@gmail.com,
peterx@redhat.com, minchan@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mm/khugepaged: skip copying lazyfree pages on collapse
Date: Fri, 2 Feb 2024 21:46:45 +0800 [thread overview]
Message-ID: <CAK1f24kdyOnUjcpnrk6j4cF6bSFXQwwzFk9tM+jD4RsO_Hc4hA@mail.gmail.com> (raw)
In-Reply-To: <ZbzmvwyTGeW18nJy@tiehlicka>
Here is a part from the man page explaining
the MADV_FREE semantics:
The kernel can thus free thesepages, but the
freeing could be delayed until memory pressure
occurs. For each of the pages that has been
marked to be freed but has not yet been freed,
the free operation will be canceled if the caller
writes into the page. If there is no subsequent
write, the kernel can free the pages at any time.
IIUC, if there is no subsequent write, lazyfree
pages will eventually be reclaimed. khugepaged
treats lazyfree pages the same as pte_none,
avoiding copying them to the new huge page
during collapse. It seems that lazyfree pages
are reclaimed before khugepaged collapses them.
This aligns with user expectations.
However, IMO, if the content of MADV_FREE pages
remains valid during collapse, then khugepaged
treating lazyfree pages the same as pte_none
might not be suitable.
Thanks,
Lance
On Fri, Feb 2, 2024 at 8:57 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Fri 02-02-24 20:52:48, Lance Yang wrote:
> > On Fri, Feb 2, 2024 at 8:27 PM Michal Hocko <mhocko@suse.com> wrote:
> > >
> > > On Fri 02-02-24 19:18:31, Lance Yang wrote:
> > > > IMO, since it's treated the same as pte_none,
> > > > perhaps lazyfree pages shouldn't be copied to
> > > > the new huge page.
> > >
> > > Why? The content of MADV_FREE page is valid until it is reclaimed.
> >
> > IMO, if MADV_FREE pages are considered valid until
> > reclaimed, treating them the same as pte_none might
> > pose a conflict.
>
> What kind of conflict?
> --
> Michal Hocko
> SUSE Labs
next prev parent reply other threads:[~2024-02-02 13:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 12:52 Lance Yang
2024-02-01 13:49 ` Lance Yang
2024-02-01 20:37 ` Yang Shi
2024-02-02 11:23 ` Lance Yang
2024-02-02 17:43 ` Yang Shi
2024-02-02 10:06 ` Michal Hocko
2024-02-02 11:18 ` Lance Yang
2024-02-02 12:27 ` Michal Hocko
2024-02-02 12:52 ` Lance Yang
2024-02-02 12:57 ` Michal Hocko
2024-02-02 13:46 ` Lance Yang [this message]
2024-02-02 14:20 ` Lance Yang
2024-02-02 14:42 ` Michal Hocko
2024-02-02 14:52 ` Lance Yang
2024-02-02 15:26 ` David Hildenbrand
2024-02-02 15:38 ` Michal Hocko
2024-02-02 17:42 ` Yang Shi
2024-02-03 4:17 ` Lance Yang
2024-02-05 19:41 ` Yang Shi
2024-02-05 9:45 ` Michal Hocko
2024-02-05 19:43 ` Yang Shi
2024-02-05 20:26 ` Zach O'Keefe
2024-02-20 10:15 ` Lance Yang
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=CAK1f24kdyOnUjcpnrk6j4cF6bSFXQwwzFk9tM+jD4RsO_Hc4hA@mail.gmail.com \
--to=ioworker0@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=peterx@redhat.com \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=zokeefe@google.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