Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

workqueue: Use list_last_entry() to get the last idle worker

It is clearer than open code.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Lai Jiangshan and committed by
Tejun Heo
d70f5d57 ae1296a7

+2 -2
+2 -2
kernel/workqueue.c
··· 2904 2904 unsigned long expires; 2905 2905 2906 2906 /* idle_list is kept in LIFO order, check the last one */ 2907 - worker = list_entry(pool->idle_list.prev, struct worker, entry); 2907 + worker = list_last_entry(&pool->idle_list, struct worker, entry); 2908 2908 expires = worker->last_active + IDLE_WORKER_TIMEOUT; 2909 2909 do_cull = !time_before(jiffies, expires); 2910 2910 ··· 2946 2946 struct worker *worker; 2947 2947 unsigned long expires; 2948 2948 2949 - worker = list_entry(pool->idle_list.prev, struct worker, entry); 2949 + worker = list_last_entry(&pool->idle_list, struct worker, entry); 2950 2950 expires = worker->last_active + IDLE_WORKER_TIMEOUT; 2951 2951 2952 2952 if (time_before(jiffies, expires)) {