Commit 906e073f authored by viresh kumar's avatar viresh kumar Committed by David S. Miller

net/ipv4: queue work on power efficient wq

Workqueue used in ipv4 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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c90cc2d
...@@ -474,7 +474,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh, ...@@ -474,7 +474,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
inet_hash_insert(dev_net(in_dev->dev), ifa); inet_hash_insert(dev_net(in_dev->dev), ifa);
cancel_delayed_work(&check_lifetime_work); cancel_delayed_work(&check_lifetime_work);
schedule_delayed_work(&check_lifetime_work, 0); queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0);
/* Send message first, then call notifier. /* Send message first, then call notifier.
Notifier will trigger FIB update, so that Notifier will trigger FIB update, so that
...@@ -684,7 +684,8 @@ static void check_lifetime(struct work_struct *work) ...@@ -684,7 +684,8 @@ static void check_lifetime(struct work_struct *work)
if (time_before(next_sched, now + ADDRCONF_TIMER_FUZZ_MAX)) if (time_before(next_sched, now + ADDRCONF_TIMER_FUZZ_MAX))
next_sched = now + ADDRCONF_TIMER_FUZZ_MAX; next_sched = now + ADDRCONF_TIMER_FUZZ_MAX;
schedule_delayed_work(&check_lifetime_work, next_sched - now); queue_delayed_work(system_power_efficient_wq, &check_lifetime_work,
next_sched - now);
} }
static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft, static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft,
...@@ -842,7 +843,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -842,7 +843,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh)
ifa = ifa_existing; ifa = ifa_existing;
set_ifa_lifetime(ifa, valid_lft, prefered_lft); set_ifa_lifetime(ifa, valid_lft, prefered_lft);
cancel_delayed_work(&check_lifetime_work); cancel_delayed_work(&check_lifetime_work);
schedule_delayed_work(&check_lifetime_work, 0); queue_delayed_work(system_power_efficient_wq,
&check_lifetime_work, 0);
rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid); rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa); blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
} }
...@@ -2322,7 +2324,7 @@ void __init devinet_init(void) ...@@ -2322,7 +2324,7 @@ void __init devinet_init(void)
register_gifconf(PF_INET, inet_gifconf); register_gifconf(PF_INET, inet_gifconf);
register_netdevice_notifier(&ip_netdev_notifier); register_netdevice_notifier(&ip_netdev_notifier);
schedule_delayed_work(&check_lifetime_work, 0); queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0);
rtnl_af_register(&inet_af_ops); rtnl_af_register(&inet_af_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment