From: Patrick Talbert <ptalbert@redhat.com>
To: netdev@vger.kernel.org
Cc: Patrick Talbert <ptalbert@redhat.com>
Subject: [PATCH net-next 1/1] [net] bonding: Add NUMA notice
Date: Thu, 5 Oct 2017 16:23:45 -0400 [thread overview]
Message-ID: <1507235025-21689-1-git-send-email-ptalbert@redhat.com> (raw)
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
next reply other threads:[~2017-10-05 20:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 20:23 Patrick Talbert [this message]
2017-10-05 21:46 ` [PATCH net-next 1/1] [net] bonding: Add NUMA notice 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1507235025-21689-1-git-send-email-ptalbert@redhat.com \
--to=ptalbert@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).