Skip to contentSkip to conversation

kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Suggestion Chen Gang 7 participants 15 messages Nov 8, 2013 – Nov 22, 2013 6 messages not in the archive cgroup

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

Hello Maintainers:

On Fedora16 with defconfig for next-20131107 kernel, use latest LTP (Linux Test Project) version, test_5() in cgroup_regression_test.sh will be fail. The related LTP output:

<<<test_start>>>
tag=cgroup stime=1383562810
cmdline=" cgroup_regression_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
cgroup_regression_test 1 TPASS : no kernel bug was found
/opt/ltp/testcases/bin/cgroup_regression_test.sh: line 118: 13283 Terminated ./fork_processes

  cgroup_regression_test    2  TPASS  :  notify_on_release is inherited
  cgroup_regression_test    3  TCONF  :  CONFIG_SCHED_DEBUG is not enabled
  cgroup_regression_test    4  TCONF  :  CONFIG_LOCKDEP is not enabled
  mount: xxx already mounted or cgroup/ busy
  cgroup_regression_test    5  TFAIL  :  mount freezer and cpuacct failed
  cgroup_regression_test    6  TCONF  :  CONFIG_CGROUP_NS
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 360: 24428 Terminated              sleep 100 < cgroup/0
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 381: 24447 Terminated              sleep 100 < cgroup/0
  cgroup_regression_test    7  TPASS  :  no kernel bug was found
  cgroup_regression_test    8  TPASS  :  no kernel bug was found
  cgroup_regression_test    9  TPASS  :  no kernel warning was found

rmdir: failed to remove `cgroup/0': No such file or directory
umount: /sys/fs/cgroup/systemd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
cgroup_regression_test 10 TPASS : no kernel warning was found
<<<execution_status>>>
initiation_status="ok"
duration=62 termination_type=exited termination_id=1 corefile=no cutime=3341 cstime=6353
<<<test_end>>>

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Welcome any additional suggestions and completions.

Thanks.
--
Chen Gang

maintainer
#1 lore raw

Hello,

Sorry about the delay.

Quoted 16 lines · Chen Gang

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Quoted 1 line

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Hmmm... I'm a bit confused. What is it testing? "cat /proc/cgroup" is showing that freezer is already mounted and the kernel seems to have correctly refused to mount it in a different hierarchy. What am I missing here?

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 4 lines · Tejun Heo

Hello,

Sorry about the delay.

Oh, No problem, every members time resources are expensive, thank you for your reply.

Quoted 17 lines · Chen Gang
Quoted 16 lines

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Quoted 7 lines
Quoted 1 line

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Hmmm... I'm a bit confused. What is it testing? "cat /proc/cgroup" is showing that freezer is already mounted and the kernel seems to have correctly refused to mount it in a different hierarchy. What am I missing here?

Hmm... I am not quit familiar about it, either, but at least I can contact related LTP members (I guess they can make sure about it).

Excuse me, I am changing/finding new job, so I should not use Asianux Corporation mail again. And it seems I can not be focus on upstream kernel as much as before. :-(

But at least, I will/should continue providing some contributions (more or less) to Public Open Source as volunteers. And for upstream kernel, I plan to make 1-3 patches per month (mainly for cross compiling).

- if can not get companies support, I can not provide enough time resource on upstream kernel (I have to get pay check for family).

- New company may mainly focus on open source tool chains (not only kernel), so I will/should also provide some contributions to them (e.g. KVM, GCC ...).

At last, sorry again for I have to give up 10 patches per month for upstream kernel.

Thanks.

Signature · 1 line
Chen Gang

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hello LTP maintainers:

When I use ltp to test cgroup, I find one failure, the related forward mail is below.

Related LTP git commit is "75df824 Add cgroup regression tests to LTP:
Those testcases can reproduce bugs we found in cgroups, and is useful
to track future regressions." ([email protected] and subrata_modak)

Please help check when you have time.

Thanks.

-------- Original Message --------
Subject: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh
Date: Fri, 08 Nov 2013 16:15:23 +0800
From: Chen Gang <[email protected]>
To: Tejun Heo <[email protected]>, Li Zefan <[email protected]>
CC: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected], "[email protected]" <[email protected]>

Hello Maintainers:

On Fedora16 with defconfig for next-20131107 kernel, use latest LTP (Linux Test Project) version, test_5() in cgroup_regression_test.sh will be fail. The related LTP output:

<<<test_start>>>
tag=cgroup stime=1383562810
cmdline=" cgroup_regression_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
cgroup_regression_test 1 TPASS : no kernel bug was found
/opt/ltp/testcases/bin/cgroup_regression_test.sh: line 118: 13283 Terminated ./fork_processes

  cgroup_regression_test    2  TPASS  :  notify_on_release is inherited
  cgroup_regression_test    3  TCONF  :  CONFIG_SCHED_DEBUG is not enabled
  cgroup_regression_test    4  TCONF  :  CONFIG_LOCKDEP is not enabled
  mount: xxx already mounted or cgroup/ busy
  cgroup_regression_test    5  TFAIL  :  mount freezer and cpuacct failed
  cgroup_regression_test    6  TCONF  :  CONFIG_CGROUP_NS
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 360: 24428 Terminated              sleep 100 < cgroup/0
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 381: 24447 Terminated              sleep 100 < cgroup/0
  cgroup_regression_test    7  TPASS  :  no kernel bug was found
  cgroup_regression_test    8  TPASS  :  no kernel bug was found
  cgroup_regression_test    9  TPASS  :  no kernel warning was found

rmdir: failed to remove `cgroup/0': No such file or directory
umount: /sys/fs/cgroup/systemd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
cgroup_regression_test 10 TPASS : no kernel warning was found
<<<execution_status>>>
initiation_status="ok"
duration=62 termination_type=exited termination_id=1 corefile=no cutime=3341 cstime=6353
<<<test_end>>>

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Welcome any additional suggestions and completions.

Thanks.
--
Chen Gang

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Hi,

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Regards,
Jan

----- Original Message -----

Quoted 97 lines

From: "Chen Gang" <[email protected]>
To: "Tejun Heo" <[email protected]>, "Garrett Cooper" <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected]
Cc: "Li Zefan" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected]
Sent: Thursday, 21 November, 2013 5:18:50 AM
Subject: Fwd: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Hello LTP maintainers:

When I use ltp to test cgroup, I find one failure, the related forward mail is below.

Related LTP git commit is "75df824 Add cgroup regression tests to LTP:
Those testcases can reproduce bugs we found in cgroups, and is useful
to track future regressions." ([email protected] and subrata_modak)

Please help check when you have time.

Thanks.

-------- Original Message --------
Subject: [Suggestion] kernel: cgroup: mount failure in LTP
cgroup_regression_test.sh
Date: Fri, 08 Nov 2013 16:15:23 +0800
From: Chen Gang <[email protected]>
To: Tejun Heo <[email protected]>, Li Zefan <[email protected]>
CC: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected], "[email protected]" <[email protected]>

Hello Maintainers:

On Fedora16 with defconfig for next-20131107 kernel, use latest LTP (Linux Test Project) version, test_5() in cgroup_regression_test.sh will be fail. The related LTP output:

<<<test_start>>>
tag=cgroup stime=1383562810
cmdline=" cgroup_regression_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
cgroup_regression_test 1 TPASS : no kernel bug was found
/opt/ltp/testcases/bin/cgroup_regression_test.sh: line 118: 13283
Terminated ./fork_processes

  cgroup_regression_test    2  TPASS  :  notify_on_release is inherited
  cgroup_regression_test    3  TCONF  :  CONFIG_SCHED_DEBUG is not enabled
  cgroup_regression_test    4  TCONF  :  CONFIG_LOCKDEP is not enabled
  mount: xxx already mounted or cgroup/ busy
  cgroup_regression_test    5  TFAIL  :  mount freezer and cpuacct failed
  cgroup_regression_test    6  TCONF  :  CONFIG_CGROUP_NS
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 360: 24428
  Terminated              sleep 100 < cgroup/0
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 381: 24447
  Terminated              sleep 100 < cgroup/0
  cgroup_regression_test    7  TPASS  :  no kernel bug was found
  cgroup_regression_test    8  TPASS  :  no kernel bug was found
  cgroup_regression_test    9  TPASS  :  no kernel warning was found

rmdir: failed to remove `cgroup/0': No such file or directory
umount: /sys/fs/cgroup/systemd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
cgroup_regression_test 10 TPASS : no kernel warning was found
<<<execution_status>>>
initiation_status="ok"
duration=62 termination_type=exited termination_id=1 corefile=no cutime=3341 cstime=6353
<<<test_end>>>

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0%
/sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0
5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Welcome any additional suggestions and completions.

Thanks.
--
Chen Gang

A message that is not in the archive (sent off-list or not yet received): 551116969.38084288.1385021094494.JavaMail.root-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#8 lore raw
Quoted 8 lines · Jan Stancek

Hi,

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 7 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

OK, for me, these information above are valuable for analyzing.

Hmm... do we have members who both the related author of LTP cgroup and kernel cgroup? If we have, I guess this issue is very simple to them, and don't need any additional analyzing by other members.

If we really have no related members for both LTP cgroup and kernel cgroup, at least, I will/should continue analyzing.

Thanks.

Quoted 101 lines

Regards,
Jan

----- Original Message -----

Quoted 97 lines

From: "Chen Gang" <[email protected]>
To: "Tejun Heo" <[email protected]>, "Garrett Cooper" <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected]
Cc: "Li Zefan" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected]
Sent: Thursday, 21 November, 2013 5:18:50 AM
Subject: Fwd: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Hello LTP maintainers:

When I use ltp to test cgroup, I find one failure, the related forward mail is below.

Related LTP git commit is "75df824 Add cgroup regression tests to LTP:
Those testcases can reproduce bugs we found in cgroups, and is useful
to track future regressions." ([email protected] and subrata_modak)

Please help check when you have time.

Thanks.

-------- Original Message --------
Subject: [Suggestion] kernel: cgroup: mount failure in LTP
cgroup_regression_test.sh
Date: Fri, 08 Nov 2013 16:15:23 +0800
From: Chen Gang <[email protected]>
To: Tejun Heo <[email protected]>, Li Zefan <[email protected]>
CC: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected], "[email protected]" <[email protected]>

Hello Maintainers:

On Fedora16 with defconfig for next-20131107 kernel, use latest LTP (Linux Test Project) version, test_5() in cgroup_regression_test.sh will be fail. The related LTP output:

<<<test_start>>>
tag=cgroup stime=1383562810
cmdline=" cgroup_regression_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
cgroup_regression_test 1 TPASS : no kernel bug was found
/opt/ltp/testcases/bin/cgroup_regression_test.sh: line 118: 13283
Terminated ./fork_processes

  cgroup_regression_test    2  TPASS  :  notify_on_release is inherited
  cgroup_regression_test    3  TCONF  :  CONFIG_SCHED_DEBUG is not enabled
  cgroup_regression_test    4  TCONF  :  CONFIG_LOCKDEP is not enabled
  mount: xxx already mounted or cgroup/ busy
  cgroup_regression_test    5  TFAIL  :  mount freezer and cpuacct failed
  cgroup_regression_test    6  TCONF  :  CONFIG_CGROUP_NS
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 360: 24428
  Terminated              sleep 100 < cgroup/0
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 381: 24447
  Terminated              sleep 100 < cgroup/0
  cgroup_regression_test    7  TPASS  :  no kernel bug was found
  cgroup_regression_test    8  TPASS  :  no kernel bug was found
  cgroup_regression_test    9  TPASS  :  no kernel warning was found

rmdir: failed to remove `cgroup/0': No such file or directory
umount: /sys/fs/cgroup/systemd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
cgroup_regression_test 10 TPASS : no kernel warning was found
<<<execution_status>>>
initiation_status="ok"
duration=62 termination_type=exited termination_id=1 corefile=no cutime=3341 cstime=6353
<<<test_end>>>

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0%
/sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0
5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Welcome any additional suggestions and completions.

Thanks.
--
Chen Gang

Signature · 1 line
Chen Gang
#9 lore raw
In reply to a message not in the archive

Hello, Jan.

Quoted 6 lines · Jan Stancek

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 6 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Ah, cgroup now requires that those recycled mounts to have matching options. This is an intended behavior change because previously we could end up with mounts which have actual options which differ from what was specified by mount, which can be misleading at the very least. Would it be possible to update LTP accordingly?

Thanks.

Signature · 1 line
tejun

A message that is not in the archive (sent off-list or not yet received): 20131121152645.GB3352-Gd/HAXX7CRxy/[email protected]

#11 lore raw

----- Original Message -----

Quoted 24 lines

From: "Tejun Heo" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "Chen Gang" <[email protected]>, "Garrett Cooper" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Li Zefan" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected]
Sent: Thursday, 21 November, 2013 4:26:45 PM
Subject: Re: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Hello, Jan.

Quoted 6 lines · Jan Stancek

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 6 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Quoted 5 lines

Ah, cgroup now requires that those recycled mounts to have matching options. This is an intended behavior change because previously we could end up with mounts which have actual options which differ from what was specified by mount, which can be misleading at the very least.

I believe the test always respected this requirement. Problem we see is because of initial state of the system. Test appears to expect that it is able to mount cgroups freely, but they are already in use.

Quoted 1 line

Would it be possible to update LTP accordingly?

I'm not sure the test can do anything (other than not run at all).

Other option is to setup system in a way where cgroups are not in use prior to running this test, though this may not be possible with systemd.

Regards,
Jan

Quoted 6 lines

Thanks.

--
tejun

A message that is not in the archive (sent off-list or not yet received): 1639659702.38807133.1385075581222.JavaMail.root-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#13 lore raw
Quoted 35 lines

----- Original Message -----

Quoted 24 lines

From: "Tejun Heo" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "Chen Gang" <[email protected]>, "Garrett Cooper" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Li Zefan" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected]
Sent: Thursday, 21 November, 2013 4:26:45 PM
Subject: Re: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Hello, Jan.

Quoted 6 lines · Jan Stancek

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 6 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Quoted 5 lines

Ah, cgroup now requires that those recycled mounts to have matching options. This is an intended behavior change because previously we could end up with mounts which have actual options which differ from what was specified by mount, which can be misleading at the very least.

I believe the test always respected this requirement. Problem we see is because of initial state of the system. Test appears to expect that it is able to mount cgroups freely, but they are already in use.

Quoted 7 lines
Quoted 1 line

Would it be possible to update LTP accordingly?

I'm not sure the test can do anything (other than not run at all).

Other option is to setup system in a way where cgroups are not in use prior to running this test, though this may not be possible with systemd.

I believe each test will do cleanup after it finishes (like umount cgroupfs). I guess the system already mounted cgroupfs after boot and each cgroup subsystem was mounted separately? And that leads to this issue.

#14 lore raw
In reply to a message not in the archive
Quoted 35 lines

----- Original Message -----

Quoted 24 lines

From: "Tejun Heo" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "Chen Gang" <[email protected]>, "Garrett Cooper" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Li Zefan" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected]
Sent: Thursday, 21 November, 2013 4:26:45 PM
Subject: Re: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh

Hello, Jan.

Quoted 6 lines · Jan Stancek

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 6 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Quoted 5 lines

Ah, cgroup now requires that those recycled mounts to have matching options. This is an intended behavior change because previously we could end up with mounts which have actual options which differ from what was specified by mount, which can be misleading at the very least.

I believe the test always respected this requirement. Problem we see is because of initial state of the system. Test appears to expect that it is able to mount cgroups freely, but they are already in use.

Quoted 7 lines
Quoted 1 line

Would it be possible to update LTP accordingly?

I'm not sure the test can do anything (other than not run at all).

Other option is to setup system in a way where cgroups are not in use prior to running this test, though this may not be possible with systemd.

I believe each test will do cleanup after it finishes (like umount cgroupfs). I guess the system already mounted cgroupfs after boot and each cgroup subsystem was mounted separately? And that leads to this issue.

#15 lore raw
In reply to a message not in the archive

Hello,

Quoted 10 lines · Jan Stancek

I believe the test always respected this requirement. Problem we see is because of initial state of the system. Test appears to expect that it is able to mount cgroups freely, but they are already in use.

Quoted 1 line

Would it be possible to update LTP accordingly?

I'm not sure the test can do anything (other than not run at all).

Other option is to setup system in a way where cgroups are not in use prior to running this test, though this may not be possible with systemd.

You can tell systemd to not mount any controllers.

Thanks.

Signature · 1 line
tejun
#16 lore raw
In reply to a message not in the archive

Hello,

Quoted 10 lines · Jan Stancek

I believe the test always respected this requirement. Problem we see is because of initial state of the system. Test appears to expect that it is able to mount cgroups freely, but they are already in use.

Quoted 1 line

Would it be possible to update LTP accordingly?

I'm not sure the test can do anything (other than not run at all).

Other option is to setup system in a way where cgroups are not in use prior to running this test, though this may not be possible with systemd.

You can tell systemd to not mount any controllers.

Thanks.

Signature · 1 line
tejun
#17 lore raw
In reply to a message not in the archive

Hello, Jan.

Quoted 6 lines · Jan Stancek

it looks like those 2 subsystems are already mounted by systemd, each in different hierarchy:

Quoted 2 lines

cpuacct 4 35 1
freezer 5 4 1

Quoted 6 lines

from Documentation/cgroups/cgroups.txt:
"If an active hierarchy with exactly the same set of subsystems already exists, it will be reused for the new mount. If no existing hierarchy matches, and any of the requested subsystems are in use in an existing hierarchy, the mount will fail with -EBUSY. Otherwise, a new hierarchy is activated, associated with the requested subsystems."

Ah, cgroup now requires that those recycled mounts to have matching options. This is an intended behavior change because previously we could end up with mounts which have actual options which differ from what was specified by mount, which can be misleading at the very least. Would it be possible to update LTP accordingly?

Thanks.

Signature · 1 line
tejun
#18 lore raw
In reply to a message not in the archive

Hello LTP maintainers:

When I use ltp to test cgroup, I find one failure, the related forward mail is below.

Related LTP git commit is "75df824 Add cgroup regression tests to LTP:
Those testcases can reproduce bugs we found in cgroups, and is useful
to track future regressions." ([email protected] and subrata_modak)

Please help check when you have time.

Thanks.

-------- Original Message --------
Subject: [Suggestion] kernel: cgroup: mount failure in LTP cgroup_regression_test.sh
Date: Fri, 08 Nov 2013 16:15:23 +0800
From: Chen Gang <[email protected]>
To: Tejun Heo <[email protected]>, Li Zefan <[email protected]>
CC: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, [email protected], "[email protected]" <[email protected]>

Hello Maintainers:

On Fedora16 with defconfig for next-20131107 kernel, use latest LTP (Linux Test Project) version, test_5() in cgroup_regression_test.sh will be fail. The related LTP output:

<<<test_start>>>
tag=cgroup stime=1383562810
cmdline=" cgroup_regression_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
cgroup_regression_test 1 TPASS : no kernel bug was found
/opt/ltp/testcases/bin/cgroup_regression_test.sh: line 118: 13283 Terminated ./fork_processes

  cgroup_regression_test    2  TPASS  :  notify_on_release is inherited
  cgroup_regression_test    3  TCONF  :  CONFIG_SCHED_DEBUG is not enabled
  cgroup_regression_test    4  TCONF  :  CONFIG_LOCKDEP is not enabled
  mount: xxx already mounted or cgroup/ busy
  cgroup_regression_test    5  TFAIL  :  mount freezer and cpuacct failed
  cgroup_regression_test    6  TCONF  :  CONFIG_CGROUP_NS
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 360: 24428 Terminated              sleep 100 < cgroup/0
  /opt/ltp/testcases/bin/cgroup_regression_test.sh: line 381: 24447 Terminated              sleep 100 < cgroup/0
  cgroup_regression_test    7  TPASS  :  no kernel bug was found
  cgroup_regression_test    8  TPASS  :  no kernel bug was found
  cgroup_regression_test    9  TPASS  :  no kernel warning was found

rmdir: failed to remove `cgroup/0': No such file or directory
umount: /sys/fs/cgroup/systemd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
cgroup_regression_test 10 TPASS : no kernel warning was found
<<<execution_status>>>
initiation_status="ok"
duration=62 termination_type=exited termination_id=1 corefile=no cutime=3341 cstime=6353
<<<test_end>>>

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Welcome any additional suggestions and completions.

Thanks.
--
Chen Gang

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw

Hello,

Sorry about the delay.

Quoted 16 lines · Chen Gang

After simplify, the related operation, environments and output are:

[root@gchenlinux tmp]# df -Th | grep cgroup
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
[root@gchenlinux tmp]# lsof | grep cgroup | grep -v grep
systemd 1 root 6r DIR 0,18 0 5998 /sys/fs/cgroup/systemd/system
[root@gchenlinux tmp]# cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
cpuset 3 4 1
cpu 4 35 1
cpuacct 4 35 1
freezer 5 4 1
[root@gchenlinux tmp]# mkdir cgroup
[root@gchenlinux tmp]# mount -t cgroup -o freezer,cpuacct xxx cgroup/
mount: xxx already mounted or cgroup/ busy

Quoted 1 line

Is it real issue of cgroup? If it is, I will/should continue analyzing.

Hmmm... I'm a bit confused. What is it testing? "cat /proc/cgroup" is showing that freezer is already mounted and the kernel seems to have correctly refused to mount it in a different hierarchy. What am I missing here?

Thanks.

Signature · 1 line
tejun