Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30815
b: refs/heads/master
c: c87e283
h: refs/heads/master
i:
  30813: 0fb8cb6
  30811: bfa9127
  30807: 41de213
  30799: 1b35455
  30783: 3e3c924
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jun 28, 2006
1 parent 9f4571a commit b1a3e37
Show file tree
Hide file tree
Showing 8 changed files with 829 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0cdbee9920fb37eb2dc49b860c2b28862d647adc
refs/heads/master: c87e2837be82df479a6bae9f155c43516d2feebc
7 changes: 7 additions & 0 deletions trunk/include/linux/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#define FUTEX_REQUEUE 3
#define FUTEX_CMP_REQUEUE 4
#define FUTEX_WAKE_OP 5
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8

/*
* Support for robust futexes: the kernel cleans up held futexes at
Expand Down Expand Up @@ -97,10 +100,14 @@ extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr);

#ifdef CONFIG_FUTEX
extern void exit_robust_list(struct task_struct *curr);
extern void exit_pi_state_list(struct task_struct *curr);
#else
static inline void exit_robust_list(struct task_struct *curr)
{
}
static inline void exit_pi_state_list(struct task_struct *curr)
{
}
#endif

#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct sched_param {
#include <asm/processor.h>

struct exec_domain;
struct futex_pi_state;

/*
* List of flags we want to share for kernel threads,
Expand Down Expand Up @@ -915,6 +916,8 @@ struct task_struct {
#ifdef CONFIG_COMPAT
struct compat_robust_list_head __user *compat_robust_list;
#endif
struct list_head pi_state_list;
struct futex_pi_state *pi_state_cache;

atomic_t fs_excl; /* holding fs exclusive resources */
struct rcu_head rcu;
Expand Down
8 changes: 8 additions & 0 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,14 @@ fastcall NORET_TYPE void do_exit(long code)
mpol_free(tsk->mempolicy);
tsk->mempolicy = NULL;
#endif
/*
* This must happen late, after the PID is not
* hashed anymore:
*/
if (unlikely(!list_empty(&tsk->pi_state_list)))
exit_pi_state_list(tsk);
if (unlikely(current->pi_state_cache))
kfree(current->pi_state_cache);
/*
* If DEBUG_MUTEXES is on, make sure we are holding no locks:
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,9 @@ static task_t *copy_process(unsigned long clone_flags,
#ifdef CONFIG_COMPAT
p->compat_robust_list = NULL;
#endif
INIT_LIST_HEAD(&p->pi_state_list);
p->pi_state_cache = NULL;

/*
* sigaltstack should be cleared when sharing the same VM
*/
Expand Down
Loading

0 comments on commit b1a3e37

Please sign in to comment.