summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-30 00:54:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:49 -0700
commitcaafa4324335aeb11bc233d5f87aca8cce30beba (patch)
treeb6371b0c084ffb91f7304a7e392b28ccfdab8a2e /include
parentab883af53ec1b87add43b32a28d8347f17d5155b (diff)
downloadblackbird-op-linux-caafa4324335aeb11bc233d5f87aca8cce30beba.tar.gz
blackbird-op-linux-caafa4324335aeb11bc233d5f87aca8cce30beba.zip
pidns: make pid->level and pid_ns->level unsigned
These values represent the nesting level of a namespace and pids living in it, and it's always non-negative. Turning this from int to unsigned int saves some space in pid.c (11 bytes on x86 and 64 on ia64) by letting the compiler optimize the pid_nr_ns a bit. E.g. on ia64 this removes the sign extension calls, which compiler adds to optimize access to pid->nubers[ns->level]. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pid.h2
-rw-r--r--include/linux/pid_namespace.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 8d199033c0ca..c21c7e8124a7 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -60,7 +60,7 @@ struct pid
/* lists of tasks that use this pid */
struct hlist_head tasks[PIDTYPE_MAX];
struct rcu_head rcu;
- int level;
+ unsigned int level;
struct upid numbers[1];
};
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index fcd61fa2c833..caff5283d15c 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -20,7 +20,7 @@ struct pid_namespace {
int last_pid;
struct task_struct *child_reaper;
struct kmem_cache *pid_cachep;
- int level;
+ unsigned int level;
struct pid_namespace *parent;
#ifdef CONFIG_PROC_FS
struct vfsmount *proc_mnt;
OpenPOWER on IntegriCloud