[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730114426.511-1-justinjiang@vivo.com>
Date: Tue, 30 Jul 2024 19:44:24 +0800
From: Zhiguo Jiang <justinjiang@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Will Deacon <will@...nel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
Nick Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>,
linux-arch@...r.kernel.org,
cgroups@...r.kernel.org,
Barry Song <21cnbao@...il.com>,
Zhiguo Jiang <justinjiang@...o.com>
Cc: opensource.kernel@...o.com
Subject: [PATCH 0/2] mm: tlb swap entries batch async release
The main reasons for the prolonged exit of a background process is the
time-consuming release of its swap entries. The proportion of swap memory
occupied by the background process increases with its duration in the
background, and after a period of time, this value can reach 60% or more.
Additionally, the relatively lengthy path for releasing swap entries
further contributes to the longer time required for the background process
to release its swap entries.
In the multiple background applications scenario, when launching a large
memory application such as a camera, system may enter a low memory state,
which will triggers the killing of multiple background processes at the
same time. Due to multiple exiting processes occupying multiple CPUs for
concurrent execution, the current foreground application's CPU resources
are tight and may cause issues such as lagging.
To solve this problem, we have introduced the multiple exiting process
asynchronous swap memory release mechanism, which isolates and caches
swap entries occupied by multiple exit processes, and hands them over
to an asynchronous kworker to complete the release. This allows the
exiting processes to complete quickly and release CPU resources. We have
validated this modification on the products and achieved the expected
benefits.
It offers several benefits:
1. Alleviate the high system cpu load caused by multiple exiting
processes running simultaneously.
2. Reduce lock competition in swap entry free path by an asynchronous
kworker instead of multiple exiting processes parallel execution.
3. Release memory occupied by exiting processes more efficiently.
Zhiguo Jiang (2):
mm: move task_is_dying to h headfile
mm: tlb: multiple exiting processes's swap entries async release
include/asm-generic/tlb.h | 50 +++++++
include/linux/mm_types.h | 58 ++++++++
include/linux/oom.h | 6 +
mm/memcontrol.c | 6 -
mm/memory.c | 3 +-
mm/mmu_gather.c | 297 ++++++++++++++++++++++++++++++++++++++
6 files changed, 413 insertions(+), 7 deletions(-)
mode change 100644 => 100755 include/asm-generic/tlb.h
mode change 100644 => 100755 include/linux/mm_types.h
mode change 100644 => 100755 include/linux/oom.h
mode change 100644 => 100755 mm/memcontrol.c
mode change 100644 => 100755 mm/memory.c
mode change 100644 => 100755 mm/mmu_gather.c
--
2.39.0
Powered by blists - more mailing lists