mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Barry Song <21cnbao@gmail.com>
Cc: zhiguojiang <justinjiang@vivo.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Muchun Song <muchun.song@linux.dev>,
	linux-arch@vger.kernel.org, cgroups@vger.kernel.org,
	kernel test robot <lkp@intel.com>,
	opensource.kernel@vivo.com
Subject: Re: [PATCH v2 0/3] mm: tlb swap entries batch async release
Date: Tue, 6 Aug 2024 15:39:47 -0700	[thread overview]
Message-ID: <20240806153947.1af20ffccfb42f1e8d981d6f@linux-foundation.org> (raw)
In-Reply-To: <CAGsJ_4x1tLEmRFbnUYcNYtV73SyBYpBtAx_syjfcnjrom-R+4w@mail.gmail.com>

On Wed, 7 Aug 2024 04:32:09 +0800 Barry Song <21cnbao@gmail.com> wrote:

> > > their independent mm, rather than parent and child processes share the
> > > same mm. Therefore, when the kernel executes multiple exiting process
> > > simultaneously, they will definitely occupy multiple CPU core resources
> > > to complete it.
> >
> > What I'm asking is why not change those userspace processes so that they
> > fork off a child process which shares the MM (shared mm_struct) and
> > then the original process exits, leaving the asynchronously-running
> > child to clean up the MM resources.
> 
> Not Zhiguo. From my perspective as a phone engineer, this issue isn't related
> to the parent-child process or the wait() function. Phones rely heavily on
> mechanisms similar to the OOM killer to function efficiently. For instance,
> if you're using apps like YouTube, TikTok, and Facebook, and then you
> open the camera app to take a photo, the camera app becomes the foreground
> process and demands a lot of memory. In this scenario, the phone might
> decide to terminate the most memory-consuming and less important apps,
> such as TikTok or YouTube, to free up memory for the camera app. TikTok
> and YouTube become less important because they are no longer occupying
> the phone's screen and have moved to the background. The faster TikTok
> and YouTube can be unmapped, the quicker the camera app can launch,
> enhancing the user experience.

I don't see how this relates to my question.

Userspace can arrange for these resources to be released in an
asynchronous fashion (can't it?).  So why change the kernel to do that?

  reply	other threads:[~2024-08-06 22:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 13:33 Zhiguo Jiang
2024-07-31 13:33 ` [PATCH v2 1/3] mm: move task_is_dying to h headfile Zhiguo Jiang
2024-07-31 13:33 ` [PATCH v2 2/3] mm: tlb: add tlb swap entries batch async release Zhiguo Jiang
2024-07-31 13:33 ` [PATCH v2 3/3] mm: s390: fix compilation warning Zhiguo Jiang
2024-08-05 12:04   ` David Hildenbrand
2024-08-05 12:10     ` zhiguojiang
2024-07-31 16:17 ` [PATCH v2 0/3] mm: tlb swap entries batch async release Andrew Morton
2024-08-01  6:30   ` zhiguojiang
2024-08-01  7:36     ` Barry Song
2024-08-01 10:33       ` zhiguojiang
2024-08-02 10:42         ` Barry Song
2024-08-02 14:42           ` zhiguojiang
2024-08-06 20:38     ` Andrew Morton
2024-08-06 20:32       ` Barry Song
2024-08-06 22:39         ` Andrew Morton [this message]
2024-08-06 22:21           ` Barry Song

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=20240806153947.1af20ffccfb42f1e8d981d6f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=21cnbao@gmail.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=arnd@arndb.de \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=justinjiang@vivo.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=npiggin@gmail.com \
    --cc=opensource.kernel@vivo.com \
    --cc=peterz@infradead.org \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=will@kernel.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

all inboxes | Powered by JetHome®