diff options
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 38 | 
1 files changed, 34 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 31bd0d97d178..253538f29ade 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -521,6 +521,7 @@ static inline int get_dumpable(struct mm_struct *mm)  #define MMF_HAS_UPROBES		19	/* has uprobes */  #define MMF_RECALC_UPROBES	20	/* MMF_HAS_UPROBES can be wrong */ +#define MMF_OOM_REAPED		21	/* mm has been already reaped */  #define MMF_INIT_MASK		(MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) @@ -668,6 +669,7 @@ struct signal_struct {  	atomic_t		sigcnt;  	atomic_t		live;  	int			nr_threads; +	atomic_t oom_victims; /* # of TIF_MEDIE threads in this thread group */  	struct list_head	thread_head;  	wait_queue_head_t	wait_chldexit;	/* for wait4() */ @@ -792,7 +794,11 @@ struct signal_struct {  	struct tty_audit_buf *tty_audit_buf;  #endif -	oom_flags_t oom_flags; +	/* +	 * Thread is the potential origin of an oom condition; kill first on +	 * oom +	 */ +	bool oom_flag_origin;  	short oom_score_adj;		/* OOM kill score adjustment */  	short oom_score_adj_min;	/* OOM kill score adjustment min value.  					 * Only settable by CAP_SYS_RESOURCE. */ @@ -1533,6 +1539,7 @@ struct task_struct {  	unsigned sched_reset_on_fork:1;  	unsigned sched_contributes_to_load:1;  	unsigned sched_migrated:1; +	unsigned sched_remote_wakeup:1;  	unsigned :0; /* force alignment to the next boundary */  	/* unserialized, strictly 'current' */ @@ -2248,6 +2255,7 @@ static inline void memalloc_noio_restore(unsigned int flags)  #define PFA_NO_NEW_PRIVS 0	/* May not gain new privileges. */  #define PFA_SPREAD_PAGE  1      /* Spread page cache over cpuset */  #define PFA_SPREAD_SLAB  2      /* Spread some slab caches over cpuset */ +#define PFA_LMK_WAITING  3      /* Lowmemorykiller is waiting */  #define TASK_PFA_TEST(name, func)					\ @@ -2271,6 +2279,9 @@ TASK_PFA_TEST(SPREAD_SLAB, spread_slab)  TASK_PFA_SET(SPREAD_SLAB, spread_slab)  TASK_PFA_CLEAR(SPREAD_SLAB, spread_slab) +TASK_PFA_TEST(LMK_WAITING, lmk_waiting) +TASK_PFA_SET(LMK_WAITING, lmk_waiting) +  /*   * task->jobctl flags   */ @@ -2721,14 +2732,26 @@ extern struct mm_struct * mm_alloc(void);  /* mmdrop drops the mm and the page tables */  extern void __mmdrop(struct mm_struct *); -static inline void mmdrop(struct mm_struct * mm) +static inline void mmdrop(struct mm_struct *mm)  {  	if (unlikely(atomic_dec_and_test(&mm->mm_count)))  		__mmdrop(mm);  } +static inline bool mmget_not_zero(struct mm_struct *mm) +{ +	return atomic_inc_not_zero(&mm->mm_users); +} +  /* mmput gets rid of the mappings and all user-space */  extern void mmput(struct mm_struct *); +#ifdef CONFIG_MMU +/* same as above but performs the slow path from the async context. Can + * be called from the atomic context as well + */ +extern void mmput_async(struct mm_struct *); +#endif +  /* Grab a reference to a task's mm, if it is not already going away */  extern struct mm_struct *get_task_mm(struct task_struct *task);  /* @@ -2757,7 +2780,14 @@ static inline int copy_thread_tls(  }  #endif  extern void flush_thread(void); -extern void exit_thread(void); + +#ifdef CONFIG_HAVE_EXIT_THREAD +extern void exit_thread(struct task_struct *tsk); +#else +static inline void exit_thread(struct task_struct *tsk) +{ +} +#endif  extern void exit_files(struct task_struct *);  extern void __cleanup_sighand(struct sighand_struct *); @@ -2977,7 +3007,7 @@ static inline int object_is_on_stack(void *obj)  	return (obj >= stack) && (obj < (stack + THREAD_SIZE));  } -extern void thread_info_cache_init(void); +extern void thread_stack_cache_init(void);  #ifdef CONFIG_DEBUG_STACK_USAGE  static inline unsigned long stack_not_used(struct task_struct *p)  |