linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm: tlb swap entries batch async release
@ 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
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Zhiguo Jiang @ 2024-07-31 13:33 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel, Will Deacon,
	Aneesh Kumar K.V, Nick Piggin, Peter Zijlstra, Arnd Bergmann,
	Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt,
	Muchun Song, linux-arch, cgroups, Barry Song, kernel test robot,
	Zhiguo Jiang
  Cc: opensource.kernel

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.

-v2:
1. fix arch s390 config compilation warning.
 Reported-by: kernel test robot <lkp@intel.com>
 Closes: https://lore.kernel.org/oe-kbuild-all/202407311703.8q8sDQ2p-lkp@intel.com/
 Reported-by: kernel test robot <lkp@intel.com>
 Closes: https://lore.kernel.org/oe-kbuild-all/202407311947.VPJNRqad-lkp@intel.com/

-v1:
 https://lore.kernel.org/linux-mm/20240730114426.511-1-justinjiang@vivo.com/

Zhiguo Jiang (3):
  mm: move task_is_dying to h headfile
  mm: tlb: add tlb swap entries batch async release
  mm: s390: fix compilation warning

 arch/s390/include/asm/tlb.h |   8 +
 include/asm-generic/tlb.h   |  44 ++++++
 include/linux/mm_types.h    |  58 +++++++
 include/linux/oom.h         |   6 +
 mm/memcontrol.c             |   6 -
 mm/memory.c                 |   3 +-
 mm/mmu_gather.c             | 297 ++++++++++++++++++++++++++++++++++++
 7 files changed, 415 insertions(+), 7 deletions(-)

-- 
2.39.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-05 12:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-31 13:33 [PATCH v2 0/3] mm: tlb swap entries batch async release 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox