Skip to contentSkip to conversation

cpuset: Fix incorrect memory_pressure control file mapping

PATCH In review Waiman Long 2 participants 3 messages Aug 24, 2017

Subsystems (2)
lore
Share & tools
lore

Waiman Long

author maintainer
#0 lore raw

PATCH 1/1 cpuset: Fix incorrect memory_pressure control file mapping

The memory_pressure control file was incorrectly set up without a private value (0, by default). As a result, this control file was treated like memory_migrate on read. By adding back the FILE_MEMORY_PRESSURE private value, the correct memory pressure value will be returned.

---
 kernel/cgroup/cpuset.c | 1 +
 1 file changed, 1 insertion(+)
kernel/cgroup/cpuset.c +1 -0
index f3539a4..84ba237 100644
@@ -1898,6 +1898,7 @@ static s64 cpuset_read_s64(struct cgroup_subsys_state *css, struct cftype *cft)
 	{
 		.name = "memory_pressure",
 		.read_u64 = cpuset_read_u64,
+		.private = FILE_MEMORY_PRESSURE,
 	},
 
 	{
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 7 lines · Waiman Long

The memory_pressure control file was incorrectly set up without a private value (0, by default). As a result, this control file was treated like memory_migrate on read. By adding back the FILE_MEMORY_PRESSURE private value, the correct memory pressure value will be returned.

Oops, applied to cgroup/for-4.13-fixes w/ stable cc'd. I broke it way back in v4.4 which makes me wonder whether anybody is actually using it.

Thanks a lot for catching it.

Signature · 1 line
tejun
author maintainer
#2 lore raw
Quoted 11 lines · Tejun Heo
Quoted 7 lines · Waiman Long

The memory_pressure control file was incorrectly set up without a private value (0, by default). As a result, this control file was treated like memory_migrate on read. By adding back the FILE_MEMORY_PRESSURE private value, the correct memory pressure value will be returned.

Oops, applied to cgroup/for-4.13-fixes w/ stable cc'd. I broke it way back in v4.4 which makes me wonder whether anybody is actually using it.

Probably not.

Cheers,
Longman