linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: alexlzhu@fb.com
Cc: linux-mm@kvack.org, kernel-team@fb.com, willy@infradead.org,
	 riel@surriel.com, hannes@cmpxchg.org,
	 Ning Zhang <ningzhang@linux.alibaba.com>
Subject: Re: [PATCH v4 2/3] mm: changes to split_huge_page() to free zero filled tail pages
Date: Tue, 18 Oct 2022 23:12:18 -0600	[thread overview]
Message-ID: <CAOUHufadTU99y9htyG=YEK_VQUE7zmFzLgzqttzV3T+rg5n0jw@mail.gmail.com> (raw)
In-Reply-To: <ff9fd618be7b9cb48d36e3635c89a2fe0b7fca65.1666150565.git.alexlzhu@fb.com>

On Tue, Oct 18, 2022 at 9:42 PM <alexlzhu@fb.com> wrote:
>
> From: Alexander Zhu <alexlzhu@fb.com>
>
> Currently, when /sys/kernel/mm/transparent_hugepage/enabled=always is set
> there are a large number of transparent hugepages that are almost entirely
> zero filled.  This is mentioned in a number of previous patchsets
> including:
> https://lore.kernel.org/all/20210731063938.1391602-1-yuzhao@google.com/
> https://lore.kernel.org/all/
> 1635422215-99394-1-git-send-email-ningzhang@linux.alibaba.com/
>
> Currently, split_huge_page() does not have a way to identify zero filled
> pages within the THP. Thus these zero pages get remapped and continue to
> create memory waste. In this patch, we identify and free tail pages that
> are zero filled in split_huge_page(). In this way, we avoid mapping these
> pages back into page table entries and can free up unused memory within
> THPs. This is based off the previously mentioned patchset by Yu Zhao.

Hi Alex,

Generally the process [1] to follow is that you keep my patches
separate from yours, rather than squash them into one, e.g., [2].

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html
[2] https://lore.kernel.org/linux-mm/cover.1665568707.git.christophe.leroy@csgroup.eu/

Also it's a courtesy to cc Ning, since his approach is (very) similar
to yours. Naturally he would wonder if you are reinventing the wheel,
so you'd have to address it in your cover letter.

> However, we chose to free anonymous zero tail pages whenever they are
> encountered instead of only on reclaim or migration.

What are cases that are not on reclaim or migration?

As I've explained off the mailing list, it's likely a bug if you
really have one. And I don't think you do. I'm currently under the
impression that you have a slab shrinker, and slab shrinkers are on
the reclaim path.

Thanks.


  reply	other threads:[~2022-10-19  5:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  3:42 [PATCH v4 0/3] THP Shrinker alexlzhu
2022-10-19  3:42 ` [PATCH v4 1/3] mm: add thp_utilization metrics to debugfs alexlzhu
2022-10-25  3:21   ` Huang, Ying
2022-10-19  3:42 ` [PATCH v4 2/3] mm: changes to split_huge_page() to free zero filled tail pages alexlzhu
2022-10-19  5:12   ` Yu Zhao [this message]
2022-10-19 18:48     ` Alex Zhu (Kernel)
2022-10-25  6:21       ` Ning Zhang
2022-10-26 19:43         ` Alex Zhu (Kernel)
2022-10-20 21:57   ` kernel test robot
2022-10-19  3:42 ` [PATCH v4 3/3] mm: THP low utilization shrinker alexlzhu
2022-10-19 15:16   ` 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='CAOUHufadTU99y9htyG=YEK_VQUE7zmFzLgzqttzV3T+rg5n0jw@mail.gmail.com' \
    --to=yuzhao@google.com \
    --cc=alexlzhu@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=ningzhang@linux.alibaba.com \
    --cc=riel@surriel.com \
    --cc=willy@infradead.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