mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
trim task_work: get rid of hlist
layout based on Oleg's suggestion; single-linked list, task->task_works points to the last element, forward pointer from said last element points to head. I'd still prefer much more regular scheme with two pointers in task_work, but... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
41f9d29f09
commit
158e1645e0
5 changed files with 38 additions and 36 deletions
|
@ -8,7 +8,7 @@ struct task_work;
|
|||
typedef void (*task_work_func_t)(struct task_work *);
|
||||
|
||||
struct task_work {
|
||||
struct hlist_node hlist;
|
||||
struct task_work *next;
|
||||
task_work_func_t func;
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,7 @@ void task_work_run(void);
|
|||
|
||||
static inline void exit_task_work(struct task_struct *task)
|
||||
{
|
||||
if (unlikely(!hlist_empty(&task->task_works)))
|
||||
if (unlikely(task->task_works))
|
||||
task_work_run();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue