From: Waiman Long <longman@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Phil Auld <pauld@redhat.com>
Subject: Re: [PATCH v2] sched/core: Don't use dying mm as active_mm of kthreads
Date: Mon, 29 Jul 2019 16:41:00 -0400 [thread overview]
Message-ID: <9e403b46-e0cb-0841-4ff7-6ecb30580d33@redhat.com> (raw)
In-Reply-To: <20190729185853.GJ9330@dhcp22.suse.cz>
On 7/29/19 2:58 PM, Michal Hocko wrote:
> On Mon 29-07-19 11:27:35, Waiman Long wrote:
>> On 7/29/19 5:12 AM, Michal Hocko wrote:
>>> On Sat 27-07-19 13:10:47, Waiman Long wrote:
>>>> It was found that a dying mm_struct where the owning task has exited
>>>> can stay on as active_mm of kernel threads as long as no other user
>>>> tasks run on those CPUs that use it as active_mm. This prolongs the
>>>> life time of dying mm holding up memory and other resources like swap
>>>> space that cannot be freed.
>>> IIRC use_mm doesn't pin the address space. It only pins the mm_struct
>>> itself. So what exactly is the problem here?
>> As explained in my response to Peter, I found that resource like swap
>> space were depleted even after the exit of the offending program in a
>> mostly idle system. This patch is to make sure that those resources get
>> freed after program exit ASAP.
> Could you elaborate more? How can a mm counter (do not confuse with
> mm_users) prevent address space to be torn down on exit?
Many of the resources tied to mm_struct are indeed freed when mm_users
becomes 0 including swap space reservation, I think. I was testing a mm
patch and it did have a missing mmput bug that cause mm_users not going
to 0. I fixed the bug, and with sched patch to speed up the release the
mm_struct, every was fine. I didn't realize that fixing the mm bug is
enough to free the swap space.
Still there are some resources not being free when the mm_count is
non-zero. It is certainly less serious than what I have thought. Sorry
for the confusion.
Cheers,
Longman
prev parent reply other threads:[~2019-07-29 20:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-27 17:10 Waiman Long
2019-07-29 8:18 ` Qais Yousef
2019-07-29 21:06 ` Waiman Long
2019-07-29 21:33 ` Qais Yousef
2019-07-29 8:52 ` Peter Zijlstra
2019-07-29 14:24 ` [PATCH] sched: Clean up active_mm reference counting Peter Zijlstra
2019-07-29 15:01 ` Mathieu Desnoyers
2019-07-29 15:16 ` Waiman Long
2019-07-29 15:22 ` Peter Zijlstra
2019-07-29 15:29 ` Rik van Riel
2019-07-29 14:27 ` [PATCH v2] sched/core: Don't use dying mm as active_mm of kthreads Peter Zijlstra
2019-07-29 15:22 ` Waiman Long
2019-07-29 15:38 ` Peter Zijlstra
2019-07-29 14:51 ` Waiman Long
2019-07-29 15:03 ` Peter Zijlstra
2019-07-29 15:28 ` Rik van Riel
2019-07-29 15:44 ` Peter Zijlstra
2019-07-29 16:10 ` Rik van Riel
2019-07-29 16:26 ` Peter Zijlstra
2019-07-29 15:37 ` Waiman Long
2019-07-29 16:12 ` Rik van Riel
2019-07-29 16:22 ` Andy Lutomirski
2019-07-29 9:12 ` Michal Hocko
2019-07-29 15:27 ` Waiman Long
2019-07-29 18:58 ` Michal Hocko
2019-07-29 20:41 ` Waiman Long [this message]
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=9e403b46-e0cb-0841-4ff7-6ecb30580d33@redhat.com \
--to=longman@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mingo@redhat.com \
--cc=pauld@redhat.com \
--cc=peterz@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