mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
[PATCH] list: use list_replace_init() instead of list_splice_init()
list_splice_init(list, head) does unneeded job if it is known that list_empty(head) == 1. We can use list_replace_init() instead. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
54e7377035
commit
626ab0e69d
7 changed files with 19 additions and 21 deletions
|
@ -531,11 +531,11 @@ int current_is_keventd(void)
|
|||
static void take_over_work(struct workqueue_struct *wq, unsigned int cpu)
|
||||
{
|
||||
struct cpu_workqueue_struct *cwq = per_cpu_ptr(wq->cpu_wq, cpu);
|
||||
LIST_HEAD(list);
|
||||
struct list_head list;
|
||||
struct work_struct *work;
|
||||
|
||||
spin_lock_irq(&cwq->lock);
|
||||
list_splice_init(&cwq->worklist, &list);
|
||||
list_replace_init(&cwq->worklist, &list);
|
||||
|
||||
while (!list_empty(&list)) {
|
||||
printk("Taking work for %s\n", wq->name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue