[systemd-devel] [patch] cgroup fs: avoid switching ->d_op on live dentry

Sedat Dilek sedat.dilek at googlemail.com
Tue Dec 21 09:56:29 PST 2010


On Tue, Dec 21, 2010 at 4:28 PM, Sedat Dilek <sedat.dilek at googlemail.com> wrote:
> What about using d_set_d_op() ?
>
> - Sedat -
>
> $ diff -Naur orig/cgroup-fs-avoid-switching-d_op-on-live-dentry.patch
> cgroup-fs-avoid-switching-d_op-on-live-dentry-v3.patch
> --- orig/cgroup-fs-avoid-switching-d_op-on-live-dentry.patch
> 2010-12-21 09:31:38.649601964 +0100
> +++ cgroup-fs-avoid-switching-d_op-on-live-dentry-v3.patch
> 2010-12-21 16:23:29.147497577 +0100
> @@ -21,6 +21,9 @@
>  ---
>  One of the patches in my vfs scaling series tripped over this, comments?
>
> +v2: Refreshed to fit linux-next (next-20101220)
> +v3: Use d_set_d_op()
> +
>  kernel/cgroup.c |   27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
>
> @@ -68,7 +71,7 @@
>
>  +      if (dentry->d_name.len > NAME_MAX)
>  +              return ERR_PTR(-ENAMETOOLONG);
> -+      dentry->d_op = &cgroup_dentry_operations;
> ++      d_set_d_op(dentry, &cgroup_dentry_operations);
>  +      d_add(dentry, NULL);
>  +      return NULL;
>  +}
> @@ -83,7 +86,7 @@
>                inode->i_size = 0;
>                inode->i_fop = &cgroup_file_operations;
>        }
> --      dentry->d_op = &cgroup_dops;
> +-      d_set_d_op(dentry, &cgroup_dops);
>        d_instantiate(dentry, inode);
>        dget(dentry);   /* Extra count - pin the dentry in core */
>        return 0;
>

v3 compiled and running (failed systemd services needs some
investigations, but that is another story).

BTW, I have enabled some cgroup debug options:

# grep -i cgroup /boot/config-$(uname -r)
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_SCHED=y
CONFIG_BLK_CGROUP=y
CONFIG_DEBUG_BLK_CGROUP=y
CONFIG_NET_CLS_CGROUP=y

- Sedat -

P.S.:

# cat /proc/version
Linux version 2.6.37-rc6-686 (Debian
2.6.37~rc6-8~next20101221.dileks.2) (sedat.dilek at gmail.com) (gcc
version 4.5.2 (Debian 4.5.2-1) ) #1 SMP Tue Dec 21 18:25:45 CET 2010

# dmesg | egrep -i 'systemd|cgroup'
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-2.6.37-rc6-686
root=UUID=1ceb69a7-ecf4-47e9-a231-b74e0f0a9b62 ro init=/bin/systemd
radeon.modeset=1 lapic 3
[    0.004574] Initializing cgroup subsys debug
[    0.004615] Initializing cgroup subsys ns
[    0.004651] ns_cgroup deprecated: consider using the
'clone_children' flag without the ns_cgroup.
[    0.004700] Initializing cgroup subsys cpuacct
[    0.004739] Initializing cgroup subsys devices
[    0.004775] Initializing cgroup subsys freezer
[    0.004810] Initializing cgroup subsys net_cls
[    0.004846] Initializing cgroup subsys blkio
[    4.111878] systemd[1]: systemd 15 running in system mode. (+PAM
-LIBWRAP -AUDIT +SELINUX +SYSVINIT -LIBCRYPTSETUP; debian)
[    4.241710] systemd[1]: Set hostname to <tbox>.
[    7.096444] systemd-logger[284]: Got error on stream: No such process
[    9.123292] systemd-fsck[499]: /dev/sda3: sauber, 128016/640848
Dateien, 1788184/2560359 Blöcke
[   15.411402] systemd[1]: ifupdown-clean.service: control process
exited, code=exited status=209
[   15.420338] systemd[1]: Unit ifupdown-clean.service entered failed state.
[   15.420808] systemd[1]: mountoverflowtmp.service: control process
exited, code=exited status=209
[   15.437782] systemd[1]: Unit mountoverflowtmp.service entered failed state.
[   15.451162] systemd[1]: resolvconf.service: control process exited,
code=exited status=209
[   15.470512] systemd[1]: Unit resolvconf.service entered failed state.
[   15.480271] systemd[1]: policykit.service: control process exited,
code=exited status=209
[   15.500513] systemd[1]: Unit policykit.service entered failed state.


More information about the systemd-devel mailing list