Thread (27 messages) flat view 27 messages, 5 authors, 2021-08-10

Re: [PATCH v3 4/9] cgroup/cpuset: Enable event notification when partition become invalid

From: Waiman Long <hidden>
Date: 2021-07-27 20:26:40
Also in: cgroups, linux-kselftest, lkml

On 7/26/21 7:14 PM, Tejun Heo wrote:
On Tue, Jul 20, 2021 at 10:18:29AM -0400, Waiman Long wrote:
quoted
+static inline void notify_partition_change(struct cpuset *cs,
+					   int old_prs, int new_prs)
+{
+	if ((old_prs == new_prs) ||
+	   ((old_prs != PRS_ERROR) && (new_prs != PRS_ERROR)))
+		return;
+	cgroup_file_notify(&cs->partition_file);
I'd generate an event on any state changes. The user have to read the file
to find out what happened anyway.

Thanks.
 From my own testing with "inotify_add_watch(fd, file, IN_MODIFY)", 
poll() will return with a event whenever a user write to 
cpuset.cpus.partition control file. I haven't really look into the sysfs 
code yet, but I believe event generation will be automatic in this case. 
So I don't think I need to explicitly add a cgroup_file_notify() when 
users modify the control file directly. Other indirect modification may 
cause the partition value to change to/from PRS_ERROR and I should have 
captured all those changes in this patchset. I will update the patch to 
note this point to make it more clear.

Cheers,
Longman

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help