mm: memcontrol: Add force_reclaim to reclaim tasks' memory in memcg 31/307131/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 3 Aug 2020 05:44:43 +0000 (14:44 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 5 Mar 2024 07:41:13 +0000 (08:41 +0100)
commitc4a234c3b4f7becec70936000623c62898e2092b
treee48305ef3f7558cddd3f6db1713725f6563b2143
parentb41b3fbde09786012a4ecfc0784ccfcfb6e32bbd
mm: memcontrol: Add force_reclaim to reclaim tasks' memory in memcg

These days, platforms tend to manage memory on low memory state
like andloid's lowmemory killer. These platforms might want to
reclaim memory from background tasks as well as kill victims
to guarantee free memory at use space level. This patch provides
an interface to reclaim a given memcg. After platform's low memory
handler moves tasks that the platform wants to reclaim to
a memcg and decides how many pages should be reclaimed, it can
reclaim the pages from the tasks by writing the number of pages
at memory.force_reclaim.

Signed-off-by: Hyunhee Kim <hyunhee.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[dwoo08.lee: ported from mailing list https://www.spinics.net/lists/cgroups/msg07874.html]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
[mszyprow: adapted for the changes from e55b9f96860f ("mm: memcontrol: drop
 dead CONFIG_MEMCG_SWAP config symbol") in Linux v6.1]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I928bf48e9715ed64135030dea44102d54d5f16f4
mm/memcontrol.c