Commit 2f2a3a46fcafa7a12d61454f67f932dfe7d84c60
Committed by
Linus Torvalds
1 parent
8990571eb5
Exists in
master
and in
4 other branches
Uninline the task_xid_nr_ns() calls
Since these are expanded into call to pid_nr_ns() anyway, it's OK to move the whole routine out-of-line. This is a cheap way to save ~100 bytes from vmlinux. Together with the previous two patches, it saves half-a-kilo from the vmlinux. Un-inline other (currently inlined) functions must be done with additional performance testing. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Paul Menage <menage@google.com> 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>
Showing 2 changed files with 28 additions and 20 deletions Side-by-side Diff
include/linux/sched.h
... | ... | @@ -1243,11 +1243,7 @@ |
1243 | 1243 | return tsk->pid; |
1244 | 1244 | } |
1245 | 1245 | |
1246 | -static inline pid_t task_pid_nr_ns(struct task_struct *tsk, | |
1247 | - struct pid_namespace *ns) | |
1248 | -{ | |
1249 | - return pid_nr_ns(task_pid(tsk), ns); | |
1250 | -} | |
1246 | +pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | |
1251 | 1247 | |
1252 | 1248 | static inline pid_t task_pid_vnr(struct task_struct *tsk) |
1253 | 1249 | { |
... | ... | @@ -1260,11 +1256,7 @@ |
1260 | 1256 | return tsk->tgid; |
1261 | 1257 | } |
1262 | 1258 | |
1263 | -static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, | |
1264 | - struct pid_namespace *ns) | |
1265 | -{ | |
1266 | - return pid_nr_ns(task_tgid(tsk), ns); | |
1267 | -} | |
1259 | +pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | |
1268 | 1260 | |
1269 | 1261 | static inline pid_t task_tgid_vnr(struct task_struct *tsk) |
1270 | 1262 | { |
... | ... | @@ -1277,11 +1269,7 @@ |
1277 | 1269 | return tsk->signal->pgrp; |
1278 | 1270 | } |
1279 | 1271 | |
1280 | -static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, | |
1281 | - struct pid_namespace *ns) | |
1282 | -{ | |
1283 | - return pid_nr_ns(task_pgrp(tsk), ns); | |
1284 | -} | |
1272 | +pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | |
1285 | 1273 | |
1286 | 1274 | static inline pid_t task_pgrp_vnr(struct task_struct *tsk) |
1287 | 1275 | { |
... | ... | @@ -1294,11 +1282,7 @@ |
1294 | 1282 | return tsk->signal->__session; |
1295 | 1283 | } |
1296 | 1284 | |
1297 | -static inline pid_t task_session_nr_ns(struct task_struct *tsk, | |
1298 | - struct pid_namespace *ns) | |
1299 | -{ | |
1300 | - return pid_nr_ns(task_session(tsk), ns); | |
1301 | -} | |
1285 | +pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | |
1302 | 1286 | |
1303 | 1287 | static inline pid_t task_session_vnr(struct task_struct *tsk) |
1304 | 1288 | { |
kernel/pid.c
... | ... | @@ -443,6 +443,30 @@ |
443 | 443 | return nr; |
444 | 444 | } |
445 | 445 | |
446 | +pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) | |
447 | +{ | |
448 | + return pid_nr_ns(task_pid(tsk), ns); | |
449 | +} | |
450 | +EXPORT_SYMBOL(task_pid_nr_ns); | |
451 | + | |
452 | +pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) | |
453 | +{ | |
454 | + return pid_nr_ns(task_tgid(tsk), ns); | |
455 | +} | |
456 | +EXPORT_SYMBOL(task_tgid_nr_ns); | |
457 | + | |
458 | +pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) | |
459 | +{ | |
460 | + return pid_nr_ns(task_pgrp(tsk), ns); | |
461 | +} | |
462 | +EXPORT_SYMBOL(task_pgrp_nr_ns); | |
463 | + | |
464 | +pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) | |
465 | +{ | |
466 | + return pid_nr_ns(task_session(tsk), ns); | |
467 | +} | |
468 | +EXPORT_SYMBOL(task_session_nr_ns); | |
469 | + | |
446 | 470 | /* |
447 | 471 | * Used by proc to find the first pid that is greater then or equal to nr. |
448 | 472 | * |