netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] cgroup: Assign subsystem IDs during compile time
@ 2012-08-24 14:01 Daniel Wagner
  2012-08-24 14:01 ` [PATCH v2 01/10] cgroup: net_cls: Use empty task_cls_classid() when !CONFIG_NET_CLS(_MODULE) Daniel Wagner
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: Daniel Wagner @ 2012-08-24 14:01 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA
  Cc: Daniel Wagner, David S. Miller, Andrew Morton, Eric Dumazet,
	Gao feng, Glauber Costa, Jamal Hadi Salim, John Fastabend,
	Kamezawa Hiroyuki, Li Zefan, Neil Horman, Tejun Heo

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

Hi,

Most notable changes are, that enabling/disabling of the jump labels
are not inside the cgroup_lock anymore (create/destroy cb). Instead
the corresponding functions will be called on module load or unload.

CGROUP_BUILTIN_SUBSYS_COUNT is also gone in this version.  This time I
trade space for speed. Some extra cycles are spend to identify the
modules in the for loops, e.g.

for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
	struct cgroup_subsys_state *ss = cgrp->subsys[i];

	/* at bootup time, we don't worry about modular subsystems */
	if (!ss || (ss && ss->module))
		continue;

	[...]
}

CGROUP_SUBSYS_COUNT is currently 12 if all controllers are built.  I
haven't found any other way to get rid of CGROUP_BUILTIN_SUBSYS_COUNT
without real dirty preprocessor tricks.

Finally, the two versions of task_cls_classid() and task_netprioidx()
are merged together.

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

v2: - do not use dirty precompiler tricks:
      use ss->module to identify modules in the loops.
    - enable/disable jump labels in module load/unload functions
    - merge builtin/module versions of task_cls_classid() and task_netprioidx
v1: - only use jump labels when built as module (#3, #4)
    - get rid of the additional 'pointer' (#5)
v0: - initial version

Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Cc: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
Cc: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
Cc: John Fastabend <john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Daniel Wagner (10):
  cgroup: net_cls: Use empty task_cls_classid() when
    !CONFIG_NET_CLS(_MODULE)
  cgroup: net_cls: Move sock_update_classid() decleration to
    cls_cgroup.h
  cgroup: net_cls: Protect access to task_cls_classid() when built as
    module
  cgroup: net_prio: Protect access to task_netprioidx() when built as
    module
  cgroup: Remove CGROUP_BUILTIN_SUBSYS_COUNT
  cgroup: Assign subsystem IDs during compile time
  cgroup: net_cls: Simplify ifdef logic
  cgroup: net_cls: Merge builtin and module version of
    task_cls_classid()
  cgroup: net_prio: Simplify ifdef logic
  cgroup: net_prio: Merge builtin and module version of
    task_netprioidx()

 include/linux/cgroup.h        | 30 ++++++++-----
 include/linux/cgroup_subsys.h | 24 +++++------
 include/net/cls_cgroup.h      | 51 +++++++++++-----------
 include/net/netprio_cgroup.h  | 48 ++++++++-------------
 include/net/sock.h            |  8 ----
 kernel/cgroup.c               | 98 +++++++++++++++++++++++--------------------
 net/core/netprio_cgroup.c     | 14 +++----
 net/core/sock.c               | 16 ++++---
 net/sched/cls_cgroup.c        | 20 ++++-----
 9 files changed, 151 insertions(+), 158 deletions(-)

-- 
1.7.12.rc1.16.g05a20c8

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

end of thread, other threads:[~2012-09-06 22:32 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 14:01 [PATCH v2 00/10] cgroup: Assign subsystem IDs during compile time Daniel Wagner
2012-08-24 14:01 ` [PATCH v2 01/10] cgroup: net_cls: Use empty task_cls_classid() when !CONFIG_NET_CLS(_MODULE) Daniel Wagner
     [not found]   ` <1345816904-21745-2-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:22     ` Tejun Heo
2012-08-27  2:32   ` Li Zefan
2012-08-24 14:01 ` [PATCH v2 03/10] cgroup: net_cls: Protect access to task_cls_classid() when built as module Daniel Wagner
     [not found]   ` <1345816904-21745-4-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:26     ` Tejun Heo
2012-08-25 16:56       ` Daniel Wagner
     [not found]         ` <503903BD.6020208-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-28 14:47           ` Paul E. McKenney
     [not found]             ` <20120828144725.GR2961-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2012-08-28 16:41               ` Daniel Wagner
2012-08-24 14:01 ` [PATCH v2 05/10] cgroup: Remove CGROUP_BUILTIN_SUBSYS_COUNT Daniel Wagner
     [not found]   ` <1345816904-21745-6-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:28     ` Tejun Heo
     [not found]       ` <20120824232840.GS21325-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-25 16:59         ` Daniel Wagner
     [not found]           ` <5039046D.1040402-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-06 22:23             ` Tejun Heo
2012-08-24 14:01 ` [PATCH v2 06/10] cgroup: Assign subsystem IDs during compile time Daniel Wagner
     [not found]   ` <1345816904-21745-7-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:38     ` Tejun Heo
     [not found]       ` <20120824233810.GT21325-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-25 17:11         ` Daniel Wagner
     [not found]           ` <50390743.2090203-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-06 22:32             ` Tejun Heo
2012-08-24 14:01 ` [PATCH v2 08/10] cgroup: net_cls: Merge builtin and module version of task_cls_classid() Daniel Wagner
     [not found]   ` <1345816904-21745-9-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:41     ` Tejun Heo
     [not found] ` <1345816904-21745-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 14:01   ` [PATCH v2 02/10] cgroup: net_cls: Move sock_update_classid() decleration to cls_cgroup.h Daniel Wagner
2012-08-24 14:01   ` [PATCH v2 04/10] cgroup: net_prio: Protect access to task_netprioidx() when built as module Daniel Wagner
     [not found]     ` <1345816904-21745-5-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:26       ` Tejun Heo
2012-08-24 14:01   ` [PATCH v2 07/10] cgroup: net_cls: Simplify ifdef logic Daniel Wagner
     [not found]     ` <1345816904-21745-8-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:39       ` Tejun Heo
2012-08-24 14:01   ` [PATCH v2 09/10] cgroup: net_prio: " Daniel Wagner
     [not found]     ` <1345816904-21745-10-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-08-24 23:42       ` Tejun Heo
2012-08-24 14:01   ` [PATCH v2 10/10] cgroup: net_prio: Merge builtin and module version of task_netprioidx() Daniel Wagner
2012-08-24 15:01   ` [PATCH v2 00/10] cgroup: Assign subsystem IDs during compile time Daniel Wagner
2012-08-24 23:15   ` Tejun Heo
     [not found]     ` <20120824231528.GO21325-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-08-25 16:49       ` 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).