Skip to contentSkip to conversation

memcontrol-implement-mem_cgroup_tryget_online.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Dec 12, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: memcontrol: implement mem_cgroup_tryget_online()
has been removed from the -mm tree. Its filename was
memcontrol-implement-mem_cgroup_tryget_online.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Nhat Pham <[email protected]>
Subject: memcontrol: implement mem_cgroup_tryget_online()
Date: Thu, 30 Nov 2023 11:40:19 -0800

This patch implements a helper function that try to get a reference to an memcg's css, as well as checking if it is online. This new function is almost exactly the same as the existing mem_cgroup_tryget(), except for the onlineness check. In the !CONFIG_MEMCG case, it always returns true, analogous to mem_cgroup_tryget(). This is useful for e.g to the new zswap writeback scheme, where we need to select the next online memcg as a candidate for the global limit reclaim.

Cc Chris Li <[email protected]>
Cc Dan Streetman <[email protected]>
Cc Domenico Cerasuolo <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Muchun Song <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Seth Jennings <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Vitaly Wool <[email protected]>

---

 include/linux/memcontrol.h |   10 ++++++++++
 1 file changed, 10 insertions(+)
include/linux/memcontrol.h renamed from include/linux/memcontrol.h~memcontrol-implement-mem_cgroup_tryget_online +10 -0
@@ -821,6 +821,11 @@ static inline bool mem_cgroup_tryget(str
 	return !memcg || css_tryget(&memcg->css);
 }
 
+static inline bool mem_cgroup_tryget_online(struct mem_cgroup *memcg)
+{
+	return !memcg || css_tryget_online(&memcg->css);
+}
+
 static inline void mem_cgroup_put(struct mem_cgroup *memcg)
 {
 	if (memcg)
@@ -1348,6 +1353,11 @@ static inline bool mem_cgroup_tryget(str
 {
 	return true;
 }
+
+static inline bool mem_cgroup_tryget_online(struct mem_cgroup *memcg)
+{
+	return true;
+}
 
 static inline void mem_cgroup_put(struct mem_cgroup *memcg)
 {

_

Patches currently in -mm which might be from [email protected] are

zswap-memcontrol-implement-zswap-writeback-disabling.patch