Skip to content

Commit f618002

Browse files
vireshkdavem330
authored andcommitted
net/neighbour: queue work on power efficient wq
Workqueue used in neighbour layer have no real dependency of scheduling these on the cpu which scheduled them. On a idle system, it is observed that an idle cpu wakes up many times just to service this work. It would be better if we can schedule it on a cpu which the scheduler believes to be the most appropriate one. This patch replaces normal workqueues with power efficient versions. This doesn't change existing behavior of code unless CONFIG_WQ_POWER_EFFICIENT is enabled. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 906e073 commit f618002

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/core/neighbour.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ static void neigh_periodic_work(struct work_struct *work)
828828
* ARP entry timeouts range from 1/2 BASE_REACHABLE_TIME to 3/2
829829
* BASE_REACHABLE_TIME.
830830
*/
831-
schedule_delayed_work(&tbl->gc_work,
831+
queue_delayed_work(system_power_efficient_wq, &tbl->gc_work,
832832
NEIGH_VAR(&tbl->parms, BASE_REACHABLE_TIME) >> 1);
833833
write_unlock_bh(&tbl->lock);
834834
}
@@ -1565,7 +1565,8 @@ static void neigh_table_init_no_netlink(struct neigh_table *tbl)
15651565

15661566
rwlock_init(&tbl->lock);
15671567
INIT_DEFERRABLE_WORK(&tbl->gc_work, neigh_periodic_work);
1568-
schedule_delayed_work(&tbl->gc_work, tbl->parms.reachable_time);
1568+
queue_delayed_work(system_power_efficient_wq, &tbl->gc_work,
1569+
tbl->parms.reachable_time);
15691570
setup_timer(&tbl->proxy_timer, neigh_proxy_process, (unsigned long)tbl);
15701571
skb_queue_head_init_class(&tbl->proxy_queue,
15711572
&neigh_table_proxy_queue_class);

0 commit comments

Comments
 (0)