mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
exit: Remove profile_handoff_task
All profile_handoff_task does is notify the task_free_notifier chain. The helpers task_handoff_register and task_handoff_unregister are used to add and delete entries from that chain and are never called. So remove the dead code and make it much easier to read and reason about __put_task_struct. Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Link: https://lkml.kernel.org/r/87fspyw6m0.fsf@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
2d4bcf886e
commit
2873cd31a2
3 changed files with 1 additions and 45 deletions
|
@ -61,14 +61,6 @@ static inline void profile_hit(int type, void *ip)
|
||||||
struct task_struct;
|
struct task_struct;
|
||||||
struct mm_struct;
|
struct mm_struct;
|
||||||
|
|
||||||
/* task is dead, free task struct ? Returns 1 if
|
|
||||||
* the task was taken, 0 if the task should be freed.
|
|
||||||
*/
|
|
||||||
int profile_handoff_task(struct task_struct * task);
|
|
||||||
|
|
||||||
int task_handoff_register(struct notifier_block * n);
|
|
||||||
int task_handoff_unregister(struct notifier_block * n);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define prof_on 0
|
#define prof_on 0
|
||||||
|
@ -93,17 +85,6 @@ static inline void profile_hit(int type, void *ip)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int task_handoff_register(struct notifier_block * n)
|
|
||||||
{
|
|
||||||
return -ENOSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int task_handoff_unregister(struct notifier_block * n)
|
|
||||||
{
|
|
||||||
return -ENOSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define profile_handoff_task(a) (0)
|
|
||||||
|
|
||||||
#endif /* CONFIG_PROFILING */
|
#endif /* CONFIG_PROFILING */
|
||||||
|
|
||||||
|
|
|
@ -754,9 +754,7 @@ void __put_task_struct(struct task_struct *tsk)
|
||||||
delayacct_tsk_free(tsk);
|
delayacct_tsk_free(tsk);
|
||||||
put_signal_struct(tsk->signal);
|
put_signal_struct(tsk->signal);
|
||||||
sched_core_free(tsk);
|
sched_core_free(tsk);
|
||||||
|
free_task(tsk);
|
||||||
if (!profile_handoff_task(tsk))
|
|
||||||
free_task(tsk);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(__put_task_struct);
|
EXPORT_SYMBOL_GPL(__put_task_struct);
|
||||||
|
|
||||||
|
|
|
@ -133,29 +133,6 @@ int __ref profile_init(void)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Profile event notifications */
|
|
||||||
|
|
||||||
static ATOMIC_NOTIFIER_HEAD(task_free_notifier);
|
|
||||||
|
|
||||||
int profile_handoff_task(struct task_struct *task)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
ret = atomic_notifier_call_chain(&task_free_notifier, 0, task);
|
|
||||||
return (ret == NOTIFY_OK) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int task_handoff_register(struct notifier_block *n)
|
|
||||||
{
|
|
||||||
return atomic_notifier_chain_register(&task_free_notifier, n);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(task_handoff_register);
|
|
||||||
|
|
||||||
int task_handoff_unregister(struct notifier_block *n)
|
|
||||||
{
|
|
||||||
return atomic_notifier_chain_unregister(&task_free_notifier, n);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(task_handoff_unregister);
|
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
|
#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
|
||||||
/*
|
/*
|
||||||
* Each cpu has a pair of open-addressed hashtables for pending
|
* Each cpu has a pair of open-addressed hashtables for pending
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue