cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lu Jialin <lujialin4@huawei.com>
To: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Cc: <cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [QUESTION]cgroup mount return -EBUSY
Date: Fri, 26 Apr 2024 12:55:04 +0800	[thread overview]
Message-ID: <5b5da2d3-37b3-60ee-5a94-149094cbe9dc@huawei.com> (raw)

Hello

I encountered a problem when I try to unmount the subsystem right after
all it's subcgroups are removed, the cgroup_root would remain. Mounting
this subsystem to another cgroup_root would return -EBUSY.

The problem could be reproduced with the following script.

test.sh:

mkdir /tmp/test1
mount -t cgroup -o pids pids /tmp/test1
mkdir /tmp/test1/test
rmdir /tmp/test1/test
umount /tmp/test1
mkdir /tmp/test
mount -t cgroup -o pids,cpu none /tmp/test

test.sh should return this.
mount: mounting none on /tmp/test failed: Device or resource busy.

It seems that when unmounting /tmp/test1, the original cgroup_root for
this PID is not released.
/test # cat /proc/cgroups

#subsys_name    hierarchy       num_cgroups     enabled

cpuset  0       1       1

cpu     0       1       1

cpuacct 0       1       1

blkio   0       1       1

devices 0       1       1

freezer 0       1       1

net_cls 0       1       1

perf_event      0       1       1

net_prio        0       1       1

hugetlb 0       1       1

pids    1       1       1

rdma    0       1       1

misc    0       1       1

debug   0       1       1

             reply	other threads:[~2024-04-26  4:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  4:55 Lu Jialin [this message]
2024-05-06  1:50 ` [QUESTION]cgroup mount return -EBUSY Lu Jialin

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=5b5da2d3-37b3-60ee-5a94-149094cbe9dc@huawei.com \
    --to=lujialin4@huawei.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).