linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] zram: objects charge to mem_cgroup
@ 2023-07-07  4:46 Zhongkun He
  2023-07-07  7:57 ` Michal Hocko
  0 siblings, 1 reply; 9+ messages in thread
From: Zhongkun He @ 2023-07-07  4:46 UTC (permalink / raw)
  To: minchan, senozhatsky, mhocko
  Cc: david, yosryahmed, linux-mm, linux-kernel, Zhongkun He

This is a new solution to charge ZRAM objects,more simple than
previous one[1],The compressed RAM is currently charged to
kernel,not to any memory cgroup.

As we know, zram can be used in two ways, direct and
indirect, this patchset can charge memory in both cases.
Direct zram usage by process within a cgroup will fail
to charge if there is no memory. Indirect zram usage by
process within a cgroup via swap in PF_MEMALLOC context,
will charge successfully.

[1]
https://lore.kernel.org/all/20230615034830.1361853-1-hezhongkun.hzk@bytedance.com/

Zhongkun He (2):
  memcg: Add support for zram object charge
  zram: charge the compressed RAM to the page's memcgroup

 drivers/block/zram/zram_drv.c | 43 +++++++++++++++++++++++++++++++++++
 drivers/block/zram/zram_drv.h |  1 +
 include/linux/memcontrol.h    | 10 ++++++++
 mm/memcontrol.c               | 23 +++++++++++++++++++
 4 files changed, 77 insertions(+)

-- 
2.25.1



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

end of thread, other threads:[~2023-07-10 15:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07  4:46 [RFC PATCH 0/2] zram: objects charge to mem_cgroup Zhongkun He
2023-07-07  7:57 ` Michal Hocko
2023-07-07 14:25   ` [External] " 贺中坤
2023-07-07 14:44     ` Michal Hocko
2023-07-10  9:35       ` 贺中坤
2023-07-10 10:41         ` Michal Hocko
2023-07-10 13:16           ` 贺中坤
2023-07-10 13:34             ` Michal Hocko
2023-07-10 15:02               ` 贺中坤

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).