netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] [net] bonding: Add NUMA notice
@ 2017-10-05 20:23 Patrick Talbert
  2017-10-05 21:46 ` Andrew Lunn
  2017-10-07 22:20 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Patrick Talbert @ 2017-10-05 20:23 UTC (permalink / raw)
  To: netdev; +Cc: Patrick Talbert

Network performance can suffer when a load balancing bond uses slave
interfaces which are in different NUMA domains.

This compares the NUMA domain of a newly enslaved interface against any
existing enslaved interfaces and prints a warning if they do not match.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
---
:100644 100644 b19dc03... 250a969... M	drivers/net/bonding/bond_main.c
 drivers/net/bonding/bond_main.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b19dc03..250a969 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -55,6 +55,7 @@
 #include <asm/dma.h>
 #include <linux/uaccess.h>
 #include <linux/errno.h>
+#include <linux/device.h>
 #include <linux/netdevice.h>
 #include <linux/inetdevice.h>
 #include <linux/igmp.h>
@@ -1450,6 +1451,21 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 		}
 	}
 
+	if (bond_has_slaves(bond)) {
+		struct list_head *iter;
+		struct slave *slave;
+
+		bond_for_each_slave(bond, slave, iter) {
+			if (slave_dev->dev.numa_node !=
+			    slave->dev->dev.numa_node) {
+				netdev_warn(bond_dev,
+					    "%s does not match NUMA domain of existing slaves. This could have a performance impact.",
+					    slave_dev->name);
+				break;
+			}
+		}
+	}
+
 	call_netdevice_notifiers(NETDEV_JOIN, slave_dev);
 
 	/* If this is the first slave, then we need to set the master's hardware
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-09 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 20:23 [PATCH net-next 1/1] [net] bonding: Add NUMA notice Patrick Talbert
2017-10-05 21:46 ` Andrew Lunn
2017-10-06 17:54   ` Patrick Talbert
2017-10-06 18:08     ` Eric Dumazet
2017-10-07 22:20 ` David Miller
2017-10-09 19:00   ` Patrick Talbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).