diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-12-06 23:36:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:34 -0500 |
commit | 34ec12349c8a9505adc59d72f92b4595bc2483ff (patch) | |
tree | 2307c825f1a0d8bf9976d5fadcc8516ad5829eac /include/linux | |
parent | 115085ea0794c0f339be8f9d25505c7f9861d824 (diff) |
[PATCH] taskstats: cleanup ->signal->stats allocation
Allocate ->signal->stats on demand in taskstats_exit(), this allows us to
remove taskstats_tgid_alloc() (the last non-trivial inline) from taskstat's
public interface.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/taskstats_kern.h | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index f1261a532496..7e9680f4afdd 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
@@ -20,28 +20,6 @@ static inline void taskstats_tgid_init(struct signal_struct *sig) | |||
20 | sig->stats = NULL; | 20 | sig->stats = NULL; |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) | ||
24 | { | ||
25 | struct signal_struct *sig = tsk->signal; | ||
26 | struct taskstats *stats; | ||
27 | |||
28 | if (sig->stats != NULL) | ||
29 | return; | ||
30 | |||
31 | /* No problem if kmem_cache_zalloc() fails */ | ||
32 | stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); | ||
33 | |||
34 | spin_lock_irq(&tsk->sighand->siglock); | ||
35 | if (!sig->stats) { | ||
36 | sig->stats = stats; | ||
37 | stats = NULL; | ||
38 | } | ||
39 | spin_unlock_irq(&tsk->sighand->siglock); | ||
40 | |||
41 | if (stats) | ||
42 | kmem_cache_free(taskstats_cache, stats); | ||
43 | } | ||
44 | |||
45 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 23 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
46 | { | 24 | { |
47 | if (sig->stats) | 25 | if (sig->stats) |
@@ -55,8 +33,6 @@ static inline void taskstats_exit(struct task_struct *tsk, int group_dead) | |||
55 | {} | 33 | {} |
56 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 34 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
57 | {} | 35 | {} |
58 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) | ||
59 | {} | ||
60 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 36 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
61 | {} | 37 | {} |
62 | static inline void taskstats_init_early(void) | 38 | static inline void taskstats_init_early(void) |