netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/5] cgroup: Assign subsystem IDs during compile time
@ 2012-08-17 14:58 Daniel Wagner
       [not found] ` <1345215494-9181-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Wagner @ 2012-08-17 14:58 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA
  Cc: Daniel Wagner

From: Daniel Wagner <daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org>

Hi,

I was able to 'fix' CGROUP_BUILTIN_SUBSYS_COUNT defition. With this
version there is no unused subsys_id. 

The number of builtin subsystem are counted with gcc's predefined
__COUNTER__ macro. This is a bit fragile, because __COUNTER__
is only reset to 0 per compile unit. There is a workaround for this.
When starting to enumate we need to store the current value of
__COUNTER__ and then subtract that from all enums we define. 

Not sure if that is okay or not.

cheers,
daniel


Original cover letter:

The patch #1 and #2 are there to be able to introduce (#3, #4) the 
jump labels in task_cls_classid() and task_netprioidx(). The jump
labels are needed to know when it is safe to access the controller. 
For example not safe means the module is not yet loaded.

All those patches are just preparation for the center piece (#5) 
of these series. This one will remove the dynamic subsystem ID
generation and falls back to compile time generated IDs. 

This is the first result from the discussion around on the
"cgroup cls & netprio 'cleanups'" patches.

This patches are against net-next


v1: - only use jump labels when built as module (#3, #4)
    - get rid of the additional 'pointer' (#5)
v0: - initial version


Daniel Wagner (5):
  cgroup: Use empty task_cls_classid() when !CONFIG_NET_CLS(_MODULE)
  cgroup: Move sock_update_classid() decleration to cls_cgroup.h
  cgroup: Protect access to task_cls_classid() when built as module
  cgroup: Protect access to task_netprioidx() when built as module
  cgroup: Assign subsystem IDs during compile time

 include/linux/cgroup.h        | 27 ++++++++++++++++++---------
 include/linux/cgroup_subsys.h | 24 ++++++++++++------------
 include/net/cls_cgroup.h      | 39 ++++++++++++++++++++++++++-------------
 include/net/netprio_cgroup.h  | 25 +++++++++++--------------
 include/net/sock.h            |  8 --------
 kernel/cgroup.c               | 25 ++++++-------------------
 net/core/netprio_cgroup.c     | 21 ++++++++++-----------
 net/core/sock.c               | 12 ++++++------
 net/sched/cls_cgroup.c        | 22 +++++++++-------------
 9 files changed, 98 insertions(+), 105 deletions(-)

-- 
1.7.12.rc1.16.g05a20c8

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

end of thread, other threads:[~2012-08-23  9:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17 14:58 [PATCH v1 0/5] cgroup: Assign subsystem IDs during compile time Daniel Wagner
     [not found] ` <1345215494-9181-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-17 14:58   ` [PATCH v1 1/5] cgroup: Use empty task_cls_classid() when !CONFIG_NET_CLS(_MODULE) Daniel Wagner
2012-08-17 14:58   ` [PATCH v1 2/5] cgroup: Move sock_update_classid() decleration to cls_cgroup.h Daniel Wagner
2012-08-17 14:58   ` [PATCH v1 3/5] cgroup: Protect access to task_cls_classid() when built as module Daniel Wagner
     [not found]     ` <1345215494-9181-4-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-17 18:28       ` Neil Horman
2012-08-20  0:59         ` Li Zefan
     [not found]           ` <50318BF9.2080803-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-08-20 11:08             ` Neil Horman
     [not found]         ` <20120817182855.GA11607-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2012-08-20 11:29           ` Daniel Wagner
     [not found]             ` <20120820112938.GA22415-rjQKm2AMs/APuY3F5OKgMy7zKzJi9e1+kcYEyfhdaNw@public.gmane.org>
2012-08-20 11:33               ` Glauber Costa
2012-08-20 17:03               ` Neil Horman
     [not found]                 ` <20120820170342.GC1734-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2012-08-21  9:12                   ` Glauber Costa
     [not found]                     ` <50335101.5030109-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-08-23  9:12                       ` Daniel Wagner
     [not found]                         ` <5035F3FC.202-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-23  9:12                           ` Glauber Costa
2012-08-17 14:58   ` [PATCH v1 4/5] cgroup: Protect access to task_netprioidx() " Daniel Wagner
2012-08-17 14:58   ` [PATCH v1 5/5] cgroup: Assign subsystem IDs during compile time Daniel Wagner

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 NNTP newsgroup(s).