diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7da33619d5d0..78eb92ae4d94 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/percpu.h> | 34 | #include <linux/percpu.h> |
35 | #include <linux/topology.h> | 35 | #include <linux/topology.h> |
36 | #include <linux/seccomp.h> | 36 | #include <linux/seccomp.h> |
37 | #include <linux/rcupdate.h> | ||
37 | 38 | ||
38 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | 39 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ |
39 | 40 | ||
@@ -350,8 +351,16 @@ struct sighand_struct { | |||
350 | atomic_t count; | 351 | atomic_t count; |
351 | struct k_sigaction action[_NSIG]; | 352 | struct k_sigaction action[_NSIG]; |
352 | spinlock_t siglock; | 353 | spinlock_t siglock; |
354 | struct rcu_head rcu; | ||
353 | }; | 355 | }; |
354 | 356 | ||
357 | extern void sighand_free_cb(struct rcu_head *rhp); | ||
358 | |||
359 | static inline void sighand_free(struct sighand_struct *sp) | ||
360 | { | ||
361 | call_rcu(&sp->rcu, sighand_free_cb); | ||
362 | } | ||
363 | |||
355 | /* | 364 | /* |
356 | * NOTE! "signal_struct" does not have it's own | 365 | * NOTE! "signal_struct" does not have it's own |
357 | * locking, because a shared signal_struct always | 366 | * locking, because a shared signal_struct always |
@@ -762,6 +771,7 @@ struct task_struct { | |||
762 | unsigned keep_capabilities:1; | 771 | unsigned keep_capabilities:1; |
763 | struct user_struct *user; | 772 | struct user_struct *user; |
764 | #ifdef CONFIG_KEYS | 773 | #ifdef CONFIG_KEYS |
774 | struct key *request_key_auth; /* assumed request_key authority */ | ||
765 | struct key *thread_keyring; /* keyring private to this thread */ | 775 | struct key *thread_keyring; /* keyring private to this thread */ |
766 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | 776 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ |
767 | #endif | 777 | #endif |
@@ -844,6 +854,7 @@ struct task_struct { | |||
844 | int cpuset_mems_generation; | 854 | int cpuset_mems_generation; |
845 | #endif | 855 | #endif |
846 | atomic_t fs_excl; /* holding fs exclusive resources */ | 856 | atomic_t fs_excl; /* holding fs exclusive resources */ |
857 | struct rcu_head rcu; | ||
847 | }; | 858 | }; |
848 | 859 | ||
849 | static inline pid_t process_group(struct task_struct *tsk) | 860 | static inline pid_t process_group(struct task_struct *tsk) |
@@ -867,8 +878,14 @@ static inline int pid_alive(struct task_struct *p) | |||
867 | extern void free_task(struct task_struct *tsk); | 878 | extern void free_task(struct task_struct *tsk); |
868 | extern void __put_task_struct(struct task_struct *tsk); | 879 | extern void __put_task_struct(struct task_struct *tsk); |
869 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 880 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
870 | #define put_task_struct(tsk) \ | 881 | |
871 | do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) | 882 | extern void __put_task_struct_cb(struct rcu_head *rhp); |
883 | |||
884 | static inline void put_task_struct(struct task_struct *t) | ||
885 | { | ||
886 | if (atomic_dec_and_test(&t->usage)) | ||
887 | call_rcu(&t->rcu, __put_task_struct_cb); | ||
888 | } | ||
872 | 889 | ||
873 | /* | 890 | /* |
874 | * Per process flags | 891 | * Per process flags |
@@ -895,6 +912,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0) | |||
895 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ | 912 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ |
896 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 913 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ |
897 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 914 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ |
915 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | ||
898 | 916 | ||
899 | /* | 917 | /* |
900 | * Only the _current_ task can read/write to tsk->flags, but other | 918 | * Only the _current_ task can read/write to tsk->flags, but other |