Skip to content

Commit

Permalink
css_put imbalance
Browse files Browse the repository at this point in the history
Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: I453cfab851487f9fe0d47b5cbd3be657c7344689
  • Loading branch information
tstruk committed Jun 1, 2022
1 parent 3bfd8e2 commit 4bea09c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/cgroup-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ enum {
CSS_RELEASED = (1 << 2), /* refcnt reached zero, released */
CSS_VISIBLE = (1 << 3), /* css is visible to userland */
CSS_DYING = (1 << 4), /* css is dying */
CSS_RELEASING = (1 << 5), /* css is being released */
};

/* bits in struct cgroup flags field */
Expand Down
3 changes: 2 additions & 1 deletion kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ void cgroup_kn_unlock(struct kernfs_node *kn)

printk("!!!!! cgroup_kn_unlock css %llx flags %x !!!\n", &cgrp->self, cgrp->self.refcnt);
//if (!percpu_ref_is_dying(&cgrp->self.refcnt))
if (!(cgrp->self.refcnt & CSS_RELEASED))
if (!(cgrp->self.flags & CSS_RELEASING))
cgroup_put(cgrp);
}

Expand Down Expand Up @@ -5112,6 +5112,7 @@ static void css_release(struct percpu_ref *ref)
struct cgroup_subsys_state *css =
container_of(ref, struct cgroup_subsys_state, refcnt);
printk("!!!!! css_release css %llx !!!\n", css);
css->flags |= CSS_RELEASING;
INIT_WORK(&css->destroy_work, css_release_work_fn);
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
Expand Down

0 comments on commit 4bea09c

Please sign in to comment.