diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-06-27 05:54:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 20:32:47 -0400 |
commit | 23f78d4a03c53cbd75d87a795378ea540aa08c86 (patch) | |
tree | 27dfe06337990911380fe8c5949ae9acd8e9568a /kernel/fork.c | |
parent | b29739f902ee76a05493fb7d2303490fc75364f4 (diff) |
[PATCH] pi-futex: rt mutex core
Core functions for the rt-mutex subsystem.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 9b4e54ef0225..b664a081fffa 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -104,6 +104,7 @@ static kmem_cache_t *mm_cachep; | |||
104 | void free_task(struct task_struct *tsk) | 104 | void free_task(struct task_struct *tsk) |
105 | { | 105 | { |
106 | free_thread_info(tsk->thread_info); | 106 | free_thread_info(tsk->thread_info); |
107 | rt_mutex_debug_task_free(tsk); | ||
107 | free_task_struct(tsk); | 108 | free_task_struct(tsk); |
108 | } | 109 | } |
109 | EXPORT_SYMBOL(free_task); | 110 | EXPORT_SYMBOL(free_task); |
@@ -913,6 +914,19 @@ asmlinkage long sys_set_tid_address(int __user *tidptr) | |||
913 | return current->pid; | 914 | return current->pid; |
914 | } | 915 | } |
915 | 916 | ||
917 | static inline void rt_mutex_init_task(struct task_struct *p) | ||
918 | { | ||
919 | #ifdef CONFIG_RT_MUTEXES | ||
920 | spin_lock_init(&p->pi_lock); | ||
921 | plist_head_init(&p->pi_waiters, &p->pi_lock); | ||
922 | p->pi_blocked_on = NULL; | ||
923 | # ifdef CONFIG_DEBUG_RT_MUTEXES | ||
924 | spin_lock_init(&p->held_list_lock); | ||
925 | INIT_LIST_HEAD(&p->held_list_head); | ||
926 | # endif | ||
927 | #endif | ||
928 | } | ||
929 | |||
916 | /* | 930 | /* |
917 | * This creates a new process as a copy of the old one, | 931 | * This creates a new process as a copy of the old one, |
918 | * but does not actually start it yet. | 932 | * but does not actually start it yet. |
@@ -1034,6 +1048,8 @@ static task_t *copy_process(unsigned long clone_flags, | |||
1034 | mpol_fix_fork_child_flag(p); | 1048 | mpol_fix_fork_child_flag(p); |
1035 | #endif | 1049 | #endif |
1036 | 1050 | ||
1051 | rt_mutex_init_task(p); | ||
1052 | |||
1037 | #ifdef CONFIG_DEBUG_MUTEXES | 1053 | #ifdef CONFIG_DEBUG_MUTEXES |
1038 | p->blocked_on = NULL; /* not blocked yet */ | 1054 | p->blocked_on = NULL; /* not blocked yet */ |
1039 | #endif | 1055 | #endif |