Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1732564
| From | Waiman Long <longman@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] cgroup: Properly init nr_tasks in cgroup_taskset |
| Date | 2017-09-14 22:50 +0200 |
| Message-ID | <upJfb-1oP-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Commit 610467270fb3 ("cgroup: don't call migration methods if there
are no tasks to migrate") introduces a new field nr_tasks to the
cgroup_taskset structure for keeping track of the number of tasks
contained in the structure. The initial value of this field, however,
is not guaranteed to be 0 as all the cgroup_taskset structures are
allocated from stack. Therefore, we need to explicitly initilized
it in the CGROUP_TASKSET_INIT() macro for the new code to behave
correctly.
Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/cgroup/cgroup-internal.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index 5151ff2..6b4c04e 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -76,6 +76,7 @@ struct cgroup_mgctx {
.src_csets = LIST_HEAD_INIT(tset.src_csets), \
.dst_csets = LIST_HEAD_INIT(tset.dst_csets), \
.csets = &tset.src_csets, \
+ .nr_tasks = 0, \
}
#define CGROUP_MGCTX_INIT(name) \
--
1.8.3.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] cgroup: Properly init nr_tasks in cgroup_taskset Waiman Long <longman@redhat.com> - 2017-09-14 22:50 +0200
Re: [PATCH] cgroup: Properly init nr_tasks in cgroup_taskset Tejun Heo <tj@kernel.org> - 2017-09-15 17:50 +0200
Re: [PATCH] cgroup: Properly init nr_tasks in cgroup_taskset Waiman Long <longman@redhat.com> - 2017-09-15 20:30 +0200
csiph-web