All of lore.kernel.org
 help / color / mirror / Atom feed
* cgroup sysfs entry
@ 2013-04-25 19:39 David Shwatrz
       [not found] ` <CAJJAcod9kNkdEvVf8GyHqqdzzC0Px1EdHwNtv68e-XtMXVo8zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: David Shwatrz @ 2013-04-25 19:39 UTC (permalink / raw)
  To: cgroups-u79uwXL29TY76Z2rM5mHXA

Hello,

I have a question about cgroup implementation:

The /sys/fs/cgroup entry is created in kernel/cgroup.c:

static struct kobject *cgroup_kobj;

cgroup_init(void) {
...
cgroup_kobj = kobject_create_and_add("cgroup", fs_kobj);
  if (!cgroup_kobj) {
  err = -ENOMEM;
  goto out;
  }

}

I wondered about this two points:
1) why is the /sys/fs/cgroup entry created at all?
2) why is this done as a sysfs entry.

The cgroup_kobj is not used anywhere in this module apart from
its creation above (and destroying if we later fail with
register_filesystem() in this same method). I don't see anywhere usage
of syfs API to create files underneath
it. In fact, the entries beneath it are created by mkdir of admin or
systemd code. so what's the point of it being a sysfs entry ? wouldn't
simply mkdir be ok ? and why under /sys/fs?

Since cgroups can be mounted by definition on every path, why this is needed?


Regards,
DavidS

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-26  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25 19:39 cgroup sysfs entry David Shwatrz
     [not found] ` <CAJJAcod9kNkdEvVf8GyHqqdzzC0Px1EdHwNtv68e-XtMXVo8zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-26  1:31   ` Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.