[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF8kJuPmp9_uS_AE2FkAy+--PhCadspSRO6osEvK9gTqWEn_ng@mail.gmail.com>
Date: Wed, 10 Sep 2025 08:40:36 -0700
From: Chris Li <chrisl@...nel.org>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>, Lei Liu <liulei.rjpt@...o.com>,
Michal Hocko <mhocko@...e.com>, David Rientjes <rientjes@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>, Kemeng Shi <shikemeng@...weicloud.com>,
Kairui Song <kasong@...cent.com>, Nhat Pham <nphamcs@...il.com>, Baoquan He <bhe@...hat.com>,
Barry Song <baohua@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, Muchun Song <muchun.song@...ux.dev>,
David Hildenbrand <david@...hat.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>, Brendan Jackman <jackmanb@...gle.com>, Zi Yan <ziy@...dia.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, Chen Yu <yu.c.chen@...el.com>,
Hao Jia <jiahao1@...iang.com>, "Kirill A. Shutemov" <kas@...nel.org>,
Usama Arif <usamaarif642@...il.com>, Oleg Nesterov <oleg@...hat.com>,
Christian Brauner <brauner@...nel.org>, Mateusz Guzik <mjguzik@...il.com>,
Steven Rostedt <rostedt@...dmis.org>, Andrii Nakryiko <andrii@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>, Fushuai Wang <wangfushuai@...du.com>,
"open list:MEMORY MANAGEMENT - OOM KILLER" <linux-mm@...ck.org>, open list <linux-kernel@...r.kernel.org>,
"open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" <cgroups@...r.kernel.org>
Subject: Re: [PATCH v0 0/2] mm: swap: Gather swap entries and batch async release
On Tue, Sep 9, 2025 at 12:48 PM Suren Baghdasaryan <surenb@...gle.com> wrote:
> > > Exiting processes compete for CPU cycles, delaying the camera preview
> > > thread and causing visible stuttering - directly impacting user
> > > experience.
> >
> > Since the exit/kill is due to low memory situation, punting the memory
> > freeing to a low priority async mechanism will help in improving user
> > experience. Most probably the application (camera preview here) will get
> > into global reclaim and will compete for CPU with the async memory
> > freeing.
> >
> > What we really need is faster memory freeing and we should explore all
> > possible ways. As others suggested fix/improve the bottleneck in the
> > memory freeing path. In addition I think we should explore parallelizing
> > this as well.
> >
> > On Android, I suppose most of the memory is associated with single or
> > small set of processes and parallelizing memory freeing would be
> > challenging. BTW is LMKD using process_mrelease() to release the killed
> > process memory?
>
> Yes, LMKD has a reaper thread which wakes up and calls
> process_mrelease() after the main LMKD thread issued SIGKILL.
I feel this is a better solution to address the exit process that is too slow.
We are basically optimizing the exit() system call, I feel there
should be something we can do in the userspace before exit() to help
us without the kernel putting too much complexity into exit().
process_mrelease() souds fit the bill pretty well.
Chris
Powered by blists - more mailing lists