Linux cgroups development
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: cgroups@vger.kernel.org
Cc: Roman Gushchin <guro@fb.com>, Tejun Heo <tj@kernel.org>,
	Zefan Li <lizefan@huawei.com>, Waiman Long <longman@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	kernel-team@fb.com, linux-kernel@vger.kernel.org
Subject: [RFC 4/4] cgroup: re-use the parent pointer in cgroup_destroy_locked()
Date: Wed, 2 Aug 2017 17:55:32 +0100	[thread overview]
Message-ID: <20170802165532.22277-5-guro@fb.com> (raw)
In-Reply-To: <20170802165532.22277-1-guro@fb.com>

As we already have a pointer to the parent cgroup in
cgroup_destroy_locked(), we don't need to calculate it again
to pass as an argument for cgroup1_check_for_release().

Signed-off-by: Roman Gushchin <guro@fb.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: kernel-team@fb.com
Cc: linux-kernel@vger.kernel.org
---
 kernel/cgroup/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index f58e1fe8bebd..2d9de4ec7727 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5022,7 +5022,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
 		tcgrp->nr_dying_descendants++;
 	}
 
-	cgroup1_check_for_release(cgroup_parent(cgrp));
+	cgroup1_check_for_release(parent);
 
 	/* put the base reference */
 	percpu_ref_kill(&cgrp->self.refcnt);
-- 
2.13.3


  parent reply	other threads:[~2017-08-02 16:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 16:55 [RFC 0/4] cgroup hierarchy controls and stats Roman Gushchin
2017-08-02 16:55 ` [RFC 1/4] cgroup: keep track of number of descent cgroups Roman Gushchin
2017-08-02 16:55 ` [RFC 2/4] cgroup: implement hierarchy limits Roman Gushchin
     [not found]   ` <20170802165532.22277-3-guro-b10kYP2dOMg@public.gmane.org>
2017-08-02 18:44     ` Tejun Heo
2017-08-02 18:55       ` Roman Gushchin
2017-08-02 16:55 ` [RFC 3/4] cgroup: add cgroup.stat interface with basic hierarchy stats Roman Gushchin
2017-08-02 16:55 ` Roman Gushchin [this message]
2017-08-02 18:50   ` [RFC 4/4] cgroup: re-use the parent pointer in cgroup_destroy_locked() Tejun Heo
     [not found] ` <20170802165532.22277-1-guro-b10kYP2dOMg@public.gmane.org>
2017-08-02 19:06   ` [RFC 0/4] cgroup hierarchy controls and stats Tejun Heo

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=20170802165532.22277-5-guro@fb.com \
    --to=guro@fb.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=longman@redhat.com \
    --cc=tj@kernel.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