diff options
author | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 12:53:44 -0700 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 12:53:44 -0700 |
commit | 54ab6db0909061ab7ee07233d3cab86d29f86e6c (patch) | |
tree | a7650ab5c0fa3a6a3841de8e8693041b3e009054 /net/core/netpoll.c | |
parent | 217e2bfab22e740227df09f22165e834cddd8a3b (diff) | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) | |
download | linux-54ab6db0909061ab7ee07233d3cab86d29f86e6c.tar.gz linux-54ab6db0909061ab7ee07233d3cab86d29f86e6c.tar.xz |
Merge tag 'v4.10-rc1' into docs-next
Linux 4.10-rc1
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 53599bd0c82d..9424673009c1 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -171,12 +171,12 @@ static void poll_one_napi(struct napi_struct *napi) static void poll_napi(struct net_device *dev) { struct napi_struct *napi; + int cpu = smp_processor_id(); list_for_each_entry(napi, &dev->napi_list, dev_list) { - if (napi->poll_owner != smp_processor_id() && - spin_trylock(&napi->poll_lock)) { + if (cmpxchg(&napi->poll_owner, -1, cpu) == -1) { poll_one_napi(napi); - spin_unlock(&napi->poll_lock); + smp_store_release(&napi->poll_owner, -1); } } } |