Loading include/linux/sched.h +4 −1 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,10 @@ struct task_struct { struct tlbflush_unmap_batch tlb_ubc; union { refcount_t rcu_users; struct rcu_head rcu; }; /* Cache last used pipe for splice(): */ struct pipe_inode_info *splice_pipe; Loading include/linux/sched/task.h +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ static inline void put_task_struct(struct task_struct *t) } struct task_struct *task_rcu_dereference(struct task_struct **ptask); void put_task_struct_rcu_user(struct task_struct *task); #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT extern int arch_task_struct_size __read_mostly; Loading kernel/exit.c +6 −1 Original line number Diff line number Diff line Loading @@ -181,6 +181,11 @@ static void delayed_put_task_struct(struct rcu_head *rhp) put_task_struct(tsk); } void put_task_struct_rcu_user(struct task_struct *task) { if (refcount_dec_and_test(&task->rcu_users)) call_rcu(&task->rcu, delayed_put_task_struct); } void release_task(struct task_struct *p) { Loading Loading @@ -221,7 +226,7 @@ void release_task(struct task_struct *p) write_unlock_irq(&tasklist_lock); release_thread(p); call_rcu(&p->rcu, delayed_put_task_struct); put_task_struct_rcu_user(p); p = leader; if (unlikely(zap_leader)) Loading kernel/fork.c +5 −3 Original line number Diff line number Diff line Loading @@ -897,10 +897,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #endif /* * One for us, one for whoever does the "release_task()" (usually * parent) * One for the user space visible state that goes away when reaped. * One for the scheduler. */ atomic_set(&tsk->usage, 2); refcount_set(&tsk->rcu_users, 2); /* One for the rcu users */ atomic_set(&tsk->usage, 1); #ifdef CONFIG_BLK_DEV_IO_TRACE tsk->btrace_seq = 0; #endif Loading kernel/sched/core.c +1 −1 Original line number Diff line number Diff line Loading @@ -3437,7 +3437,7 @@ static struct rq *finish_task_switch(struct task_struct *prev) /* Task is done with its stack. */ put_task_stack(prev); put_task_struct(prev); put_task_struct_rcu_user(prev); } tick_nohz_task_switch(); Loading Loading
include/linux/sched.h +4 −1 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,10 @@ struct task_struct { struct tlbflush_unmap_batch tlb_ubc; union { refcount_t rcu_users; struct rcu_head rcu; }; /* Cache last used pipe for splice(): */ struct pipe_inode_info *splice_pipe; Loading
include/linux/sched/task.h +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ static inline void put_task_struct(struct task_struct *t) } struct task_struct *task_rcu_dereference(struct task_struct **ptask); void put_task_struct_rcu_user(struct task_struct *task); #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT extern int arch_task_struct_size __read_mostly; Loading
kernel/exit.c +6 −1 Original line number Diff line number Diff line Loading @@ -181,6 +181,11 @@ static void delayed_put_task_struct(struct rcu_head *rhp) put_task_struct(tsk); } void put_task_struct_rcu_user(struct task_struct *task) { if (refcount_dec_and_test(&task->rcu_users)) call_rcu(&task->rcu, delayed_put_task_struct); } void release_task(struct task_struct *p) { Loading Loading @@ -221,7 +226,7 @@ void release_task(struct task_struct *p) write_unlock_irq(&tasklist_lock); release_thread(p); call_rcu(&p->rcu, delayed_put_task_struct); put_task_struct_rcu_user(p); p = leader; if (unlikely(zap_leader)) Loading
kernel/fork.c +5 −3 Original line number Diff line number Diff line Loading @@ -897,10 +897,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #endif /* * One for us, one for whoever does the "release_task()" (usually * parent) * One for the user space visible state that goes away when reaped. * One for the scheduler. */ atomic_set(&tsk->usage, 2); refcount_set(&tsk->rcu_users, 2); /* One for the rcu users */ atomic_set(&tsk->usage, 1); #ifdef CONFIG_BLK_DEV_IO_TRACE tsk->btrace_seq = 0; #endif Loading
kernel/sched/core.c +1 −1 Original line number Diff line number Diff line Loading @@ -3437,7 +3437,7 @@ static struct rq *finish_task_switch(struct task_struct *prev) /* Task is done with its stack. */ put_task_stack(prev); put_task_struct(prev); put_task_struct_rcu_user(prev); } tick_nohz_task_switch(); Loading