public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] cgroup: Properly init nr_tasks in cgroup_taskset
Date: Thu, 14 Sep 2017 13:45:13 -0700	[thread overview]
Message-ID: <1505421913-29577-1-git-send-email-longman@redhat.com> (raw)

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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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

             reply	other threads:[~2017-09-14 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 20:45 Waiman Long [this message]
     [not found] ` <1505421913-29577-1-git-send-email-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-15 15:47   ` [PATCH] cgroup: Properly init nr_tasks in cgroup_taskset Tejun Heo
     [not found]     ` <20170915154743.GF378890-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2017-09-15 18:28       ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505421913-29577-1-git-send-email-longman@redhat.com \
    --to=longman-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox