From: zhiguojiang <justinjiang@vivo.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH] mm: memcg supports freeing the specified zone's memory
Date: Fri, 17 Jan 2025 18:25:13 +0800 [thread overview]
Message-ID: <3156c69f-b52d-4777-ba38-4c32ebc16b24@vivo.com> (raw)
In-Reply-To: <Z4okBYrYD8G1WdKx@tiehlicka>
在 2025/1/17 17:33, Michal Hocko 写道:
> On Fri 17-01-25 12:41:40, zhiguojiang wrote:
> [...]
>> In response to the above situation, we need reclaim only the normal
>> zone's memory occupied by memcg by try_to_free_mem_cgroup_pages(), in
>> order to solve the issues of the gfp flags allocations and failure due
>> to gfp flags limited only to alloc memory from the normal zone. At this
>> point, if the memcg memory reclaimed by try_to_free_mem_cgroup_pages()
>> mainly comes from the movable zone, which cannot solve such problems.
> Memory cgroup reclaim doesn't allocate the memory directly. This is done
Yes, what I mean is that we hope to reclaim accurately the specified
zone's memory occupied by memcg through try_to_free_mem_cgroup_pages(),
in order to meet the current system's memory allocation requirements
for the specified zone on the memory allocate path.
> by the page allocator called before the memory is charged. The memcg
> charging is then responsible for reclaiming charges and that is not
> really zone aware.
>
> Could you describe problem that you are trying to solve?
In a dual zone system with both movable and normal zones, we encountered
the problem where the GFP_KERNEL flag failed to allocate memory from the
normal zone and crashed. Analyzing the logs, we found that there was
very little free memory in the normal zone, but more free memory in the
movable zone at this time. Therefore, we want to reclaim accurately
the normal zone's memory occupied by memcg through
try_to_free_mem_cgroup_pages().
Thanks
next prev parent reply other threads:[~2025-01-17 10:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 14:22 Zhiguo Jiang
2025-01-16 14:36 ` Michal Hocko
2025-01-17 4:41 ` zhiguojiang
2025-01-17 9:33 ` Michal Hocko
2025-01-17 10:25 ` zhiguojiang [this message]
2025-01-17 11:43 ` Michal Hocko
2025-01-20 1:22 ` zhiguojiang
2025-01-20 9:40 ` Michal Hocko
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=3156c69f-b52d-4777-ba38-4c32ebc16b24@vivo.com \
--to=justinjiang@vivo.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=opensource.kernel@vivo.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
/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