* [RFC Patch V1 03/30] mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 04/30] mm, netfilter: " Jiang Liu
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, David S. Miller,
Steffen Klassert, Herbert Xu, Veaceslav Falico, Eric Dumazet,
Vlad Yasevich, Eric W. Biederman, stephen hemminger, Jerry Chu,
Ben Hutchings, Fan Du, Mathias Krause, Thomas Graf, Jiang Liu,
Joe Perches, Roman Gushchin
Cc: Tony Luck, linux-mm, linux-hotplug, linux-kernel, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
net/core/dev.c | 6 +++---
net/core/flow.c | 2 +-
net/core/pktgen.c | 10 +++++-----
net/core/sysctl_net_core.c | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 30eedf677913..e4c1e84374b7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1910,7 +1910,7 @@ static struct xps_map *expand_xps_map(struct xps_map *map,
/* Need to allocate new map to store queue on this CPU's map */
new_map = kzalloc_node(XPS_MAP_SIZE(alloc_len), GFP_KERNEL,
- cpu_to_node(cpu));
+ cpu_to_mem(cpu));
if (!new_map)
return NULL;
@@ -1973,8 +1973,8 @@ int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask,
map->queues[map->len++] = index;
#ifdef CONFIG_NUMA
if (numa_node_id == -2)
- numa_node_id = cpu_to_node(cpu);
- else if (numa_node_id != cpu_to_node(cpu))
+ numa_node_id = cpu_to_mem(cpu);
+ else if (numa_node_id != cpu_to_mem(cpu))
numa_node_id = -1;
#endif
} else if (dev_maps) {
diff --git a/net/core/flow.c b/net/core/flow.c
index a0348fde1fdf..4139dbb50cc0 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -396,7 +396,7 @@ static int flow_cache_cpu_prepare(struct flow_cache *fc, int cpu)
size_t sz = sizeof(struct hlist_head) * flow_cache_hash_size(fc);
if (!fcp->hash_table) {
- fcp->hash_table = kzalloc_node(sz, GFP_KERNEL, cpu_to_node(cpu));
+ fcp->hash_table = kzalloc_node(sz, GFP_KERNEL, cpu_to_mem(cpu));
if (!fcp->hash_table) {
pr_err("NET: failed to allocate flow cache sz %zu\n", sz);
return -ENOMEM;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fc17a9d309ac..45d18f88dce4 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2653,7 +2653,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
(datalen/frags) : PAGE_SIZE;
while (datalen > 0) {
if (unlikely(!pkt_dev->page)) {
- int node = numa_node_id();
+ int node = numa_mem_id();
if (pkt_dev->node >= 0 && (pkt_dev->flags & F_NODE))
node = pkt_dev->node;
@@ -2698,7 +2698,7 @@ static struct sk_buff *pktgen_alloc_skb(struct net_device *dev,
pkt_dev->pkt_overhead;
if (pkt_dev->flags & F_NODE) {
- int node = pkt_dev->node >= 0 ? pkt_dev->node : numa_node_id();
+ int node = pkt_dev->node >= 0 ? pkt_dev->node : numa_mem_id();
skb = __alloc_skb(NET_SKB_PAD + size, GFP_NOWAIT, 0, node);
if (likely(skb)) {
@@ -3533,7 +3533,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
{
struct pktgen_dev *pkt_dev;
int err;
- int node = cpu_to_node(t->cpu);
+ int node = cpu_to_mem(t->cpu);
/* We don't allow a device to be on several threads */
@@ -3621,7 +3621,7 @@ static int __net_init pktgen_create_thread(int cpu, struct pktgen_net *pn)
struct task_struct *p;
t = kzalloc_node(sizeof(struct pktgen_thread), GFP_KERNEL,
- cpu_to_node(cpu));
+ cpu_to_mem(cpu));
if (!t) {
pr_err("ERROR: out of memory, can't create new thread\n");
return -ENOMEM;
@@ -3637,7 +3637,7 @@ static int __net_init pktgen_create_thread(int cpu, struct pktgen_net *pn)
p = kthread_create_on_node(pktgen_thread_worker,
t,
- cpu_to_node(cpu),
+ cpu_to_mem(cpu),
"kpktgend_%d", cpu);
if (IS_ERR(p)) {
pr_err("kernel_thread() failed for cpu %d\n", t->cpu);
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index cf9cd13509a7..1375447b833e 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -123,7 +123,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
kfree(cur);
} else if (!cur && cpumask_test_cpu(i, mask)) {
cur = kzalloc_node(len, GFP_KERNEL,
- cpu_to_node(i));
+ cpu_to_mem(i));
if (!cur) {
/* not unwinding previous changes */
ret = -ENOMEM;
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 04/30] mm, netfilter: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
2014-07-11 7:37 ` [RFC Patch V1 03/30] mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 10/30] mm, xfrm: " Jiang Liu
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Pablo Neira Ayuso,
Patrick McHardy, Jozsef Kadlecsik, David S. Miller
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
netfilter-devel, coreteam, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
net/netfilter/x_tables.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 227aa11e8409..6e7d4bc81422 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -692,10 +692,10 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
if (size <= PAGE_SIZE)
newinfo->entries[cpu] = kmalloc_node(size,
GFP_KERNEL,
- cpu_to_node(cpu));
+ cpu_to_mem(cpu));
else
newinfo->entries[cpu] = vmalloc_node(size,
- cpu_to_node(cpu));
+ cpu_to_mem(cpu));
if (newinfo->entries[cpu] == NULL) {
xt_free_table_info(newinfo);
@@ -801,10 +801,10 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
for_each_possible_cpu(cpu) {
if (size > PAGE_SIZE)
i->jumpstack[cpu] = vmalloc_node(size,
- cpu_to_node(cpu));
+ cpu_to_mem(cpu));
else
i->jumpstack[cpu] = kmalloc_node(size,
- GFP_KERNEL, cpu_to_node(cpu));
+ GFP_KERNEL, cpu_to_mem(cpu));
if (i->jumpstack[cpu] == NULL)
/*
* Freeing will be done later on by the callers. The
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 10/30] mm, xfrm: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
2014-07-11 7:37 ` [RFC Patch V1 03/30] mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 04/30] mm, netfilter: " Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 13/30] mm, i40e: " Jiang Liu
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Steffen Klassert, Herbert Xu,
David S. Miller
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
net/xfrm/xfrm_ipcomp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index ccfdc7115a83..129f469ae75d 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -235,7 +235,7 @@ static void * __percpu *ipcomp_alloc_scratches(void)
for_each_possible_cpu(i) {
void *scratch;
- scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_node(i));
+ scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_mem(i));
if (!scratch)
return NULL;
*per_cpu_ptr(scratches, i) = scratch;
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 13/30] mm, i40e: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
` (2 preceding siblings ...)
2014-07-11 7:37 ` [RFC Patch V1 10/30] mm, xfrm: " Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 14/30] mm, i40evf: " Jiang Liu
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
e1000-devel, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index e49f31dbd5d8..e9f6f9efd944 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1342,7 +1342,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
unsigned int total_rx_bytes = 0, total_rx_packets = 0;
u16 rx_packet_len, rx_header_len, rx_sph, rx_hbo;
u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
- const int current_node = numa_node_id();
+ const int current_node = numa_mem_id();
struct i40e_vsi *vsi = rx_ring->vsi;
u16 i = rx_ring->next_to_clean;
union i40e_rx_desc *rx_desc;
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 14/30] mm, i40evf: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
` (3 preceding siblings ...)
2014-07-11 7:37 ` [RFC Patch V1 13/30] mm, i40e: " Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 15/30] mm, igb: " Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 16/30] mm, ixgbe: " Jiang Liu
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
e1000-devel, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 48ebb6cd69f2..5c057ae21c22 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -877,7 +877,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
unsigned int total_rx_bytes = 0, total_rx_packets = 0;
u16 rx_packet_len, rx_header_len, rx_sph, rx_hbo;
u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
- const int current_node = numa_node_id();
+ const int current_node = numa_mem_id();
struct i40e_vsi *vsi = rx_ring->vsi;
u16 i = rx_ring->next_to_clean;
union i40e_rx_desc *rx_desc;
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
` (4 preceding siblings ...)
2014-07-11 7:37 ` [RFC Patch V1 14/30] mm, i40evf: " Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
2014-07-21 17:42 ` Nishanth Aravamudan
2014-07-11 7:37 ` [RFC Patch V1 16/30] mm, ixgbe: " Jiang Liu
6 siblings, 1 reply; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
e1000-devel, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index f145adbb55ac..2b74bffa5648 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6518,7 +6518,7 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
unsigned int truesize)
{
/* avoid re-using remote pages */
- if (unlikely(page_to_nid(page) != numa_node_id()))
+ if (unlikely(page_to_nid(page) != numa_mem_id()))
return false;
#if (PAGE_SIZE < 8192)
@@ -6588,7 +6588,7 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
/* we can reuse buffer as-is, just make sure it is local */
- if (likely(page_to_nid(page) == numa_node_id()))
+ if (likely(page_to_nid(page) == numa_mem_id()))
return true;
/* this page cannot be reused so discard it */
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RFC Patch V1 16/30] mm, ixgbe: Use cpu_to_mem()/numa_mem_id() to support memoryless node
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
` (5 preceding siblings ...)
2014-07-11 7:37 ` [RFC Patch V1 15/30] mm, igb: " Jiang Liu
@ 2014-07-11 7:37 ` Jiang Liu
6 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-11 7:37 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS
Cc: Jiang Liu, Tony Luck, linux-mm, linux-hotplug, linux-kernel,
e1000-devel, netdev
When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
may return a node without memory, and later cause system failure/panic
when calling kmalloc_node() and friends with returned node id.
So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
memory for the/current cpu.
If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
is the same as cpu_to_node()/numa_node_id().
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f5aa3311ea28..46dc083573ea 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1962,7 +1962,7 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,
memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
/* we can reuse buffer as-is, just make sure it is local */
- if (likely(page_to_nid(page) == numa_node_id()))
+ if (likely(page_to_nid(page) == numa_mem_id()))
return true;
/* this page cannot be reused so discard it */
@@ -1974,7 +1974,7 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,
rx_buffer->page_offset, size, truesize);
/* avoid re-using remote pages */
- if (unlikely(page_to_nid(page) != numa_node_id()))
+ if (unlikely(page_to_nid(page) != numa_mem_id()))
return false;
#if (PAGE_SIZE < 8192)
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
2014-07-11 7:37 ` [RFC Patch V1 15/30] mm, igb: " Jiang Liu
@ 2014-07-21 17:42 ` Nishanth Aravamudan
2014-07-21 19:53 ` Alexander Duyck
0 siblings, 1 reply; 11+ messages in thread
From: Nishanth Aravamudan @ 2014-07-21 17:42 UTC (permalink / raw)
To: Jiang Liu
Cc: Peter Zijlstra, linux-hotplug, linux-mm, Mike Galbraith,
e1000-devel, Rafael J . Wysocki, Jesse Brandeburg, Mel Gorman,
David Rientjes, Linux NICS, Tony Luck, netdev, Bruce Allan,
linux-kernel, John Ronciak, Andrew Morton
On 11.07.2014 [15:37:32 +0800], Jiang Liu wrote:
> When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
> may return a node without memory, and later cause system failure/panic
> when calling kmalloc_node() and friends with returned node id.
> So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
> memory for the/current cpu.
>
> If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
> is the same as cpu_to_node()/numa_node_id().
>
> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index f145adbb55ac..2b74bffa5648 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -6518,7 +6518,7 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
> unsigned int truesize)
> {
> /* avoid re-using remote pages */
> - if (unlikely(page_to_nid(page) != numa_node_id()))
> + if (unlikely(page_to_nid(page) != numa_mem_id()))
> return false;
>
> #if (PAGE_SIZE < 8192)
> @@ -6588,7 +6588,7 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
> memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
>
> /* we can reuse buffer as-is, just make sure it is local */
> - if (likely(page_to_nid(page) == numa_node_id()))
> + if (likely(page_to_nid(page) == numa_mem_id()))
> return true;
>
> /* this page cannot be reused so discard it */
This doesn't seem to have anything to do with crashes or errors?
The original code is checking if the NUMA node of a page is remote to
the NUMA node current is running on. Your change makes it check if the
NUMA node of a page is not equal to the nearest NUMA node with memory.
That's not necessarily local, though, which seems like that is the whole
point. In this case, perhaps the driver author doesn't want to reuse the
memory at all for performance reasons? In any case, I don't think this
patch has appropriate justification.
Thanks,
Nish
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
2014-07-21 17:42 ` Nishanth Aravamudan
@ 2014-07-21 19:53 ` Alexander Duyck
2014-07-21 21:09 ` Nishanth Aravamudan
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Duyck @ 2014-07-21 19:53 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: Jiang Liu, Andrew Morton, Mel Gorman, David Rientjes,
Mike Galbraith, Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS,
Tony Luck, linux-mm, linux-hotplug, linux-kernel, e1000-devel,
Netdev
[-- Attachment #1: Type: text/plain, Size: 3100 bytes --]
I do agree the description should probably be changed. There shouldn't be
any panics involved, only a performance impact as it will be reallocating
always if it is on a node with no memory.
My intention on this was to make certain that the memory used is from the
closest node possible. As such I believe this change likely honours that.
Thanks,
Alex
On Mon, Jul 21, 2014 at 10:42 AM, Nishanth Aravamudan <
nacc@linux.vnet.ibm.com> wrote:
> On 11.07.2014 [15:37:32 +0800], Jiang Liu wrote:
> > When CONFIG_HAVE_MEMORYLESS_NODES is enabled,
> cpu_to_node()/numa_node_id()
> > may return a node without memory, and later cause system failure/panic
> > when calling kmalloc_node() and friends with returned node id.
> > So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
> > memory for the/current cpu.
> >
> > If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
> > is the same as cpu_to_node()/numa_node_id().
> >
> > Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
> > ---
> > drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c
> > index f145adbb55ac..2b74bffa5648 100644
> > --- a/drivers/net/ethernet/intel/igb/igb_main.c
> > +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> > @@ -6518,7 +6518,7 @@ static bool igb_can_reuse_rx_page(struct
> igb_rx_buffer *rx_buffer,
> > unsigned int truesize)
> > {
> > /* avoid re-using remote pages */
> > - if (unlikely(page_to_nid(page) != numa_node_id()))
> > + if (unlikely(page_to_nid(page) != numa_mem_id()))
> > return false;
> >
> > #if (PAGE_SIZE < 8192)
> > @@ -6588,7 +6588,7 @@ static bool igb_add_rx_frag(struct igb_ring
> *rx_ring,
> > memcpy(__skb_put(skb, size), va, ALIGN(size,
> sizeof(long)));
> >
> > /* we can reuse buffer as-is, just make sure it is local */
> > - if (likely(page_to_nid(page) == numa_node_id()))
> > + if (likely(page_to_nid(page) == numa_mem_id()))
> > return true;
> >
> > /* this page cannot be reused so discard it */
>
> This doesn't seem to have anything to do with crashes or errors?
>
> The original code is checking if the NUMA node of a page is remote to
> the NUMA node current is running on. Your change makes it check if the
> NUMA node of a page is not equal to the nearest NUMA node with memory.
> That's not necessarily local, though, which seems like that is the whole
> point. In this case, perhaps the driver author doesn't want to reuse the
> memory at all for performance reasons? In any case, I don't think this
> patch has appropriate justification.
>
> Thanks,
> Nish
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
[-- Attachment #2: Type: text/html, Size: 4131 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
2014-07-21 19:53 ` Alexander Duyck
@ 2014-07-21 21:09 ` Nishanth Aravamudan
2014-07-23 3:20 ` Jiang Liu
0 siblings, 1 reply; 11+ messages in thread
From: Nishanth Aravamudan @ 2014-07-21 21:09 UTC (permalink / raw)
To: Alexander Duyck
Cc: Jiang Liu, Andrew Morton, Mel Gorman, David Rientjes,
Mike Galbraith, Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS,
Tony Luck, linux-mm, linux-hotplug@
On 21.07.2014 [12:53:33 -0700], Alexander Duyck wrote:
> I do agree the description should probably be changed. There shouldn't be
> any panics involved, only a performance impact as it will be reallocating
> always if it is on a node with no memory.
Yep, thanks for the review.
> My intention on this was to make certain that the memory used is from the
> closest node possible. As such I believe this change likely honours that.
Absolutely, just wanted to make it explicit that it's not a functional
fix, just a performance fix (presuming this shows up at all on systems
that have memoryless NUMA nodes).
I'd suggest an update to the comments, as well.
Thanks,
Nish
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
2014-07-21 21:09 ` Nishanth Aravamudan
@ 2014-07-23 3:20 ` Jiang Liu
0 siblings, 0 replies; 11+ messages in thread
From: Jiang Liu @ 2014-07-23 3:20 UTC (permalink / raw)
To: Nishanth Aravamudan, Alexander Duyck
Cc: Andrew Morton, Mel Gorman, David Rientjes, Mike Galbraith,
Peter Zijlstra, Rafael J . Wysocki, Jeff Kirsher,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS,
Tony Luck, linux-mm, linux-hotplug, linux-kernel, e1000-devel,
Netdev
Hi Nishanth and Alexander,
Thanks for review, will update the comments
in next version.
Regards!
Gerry
On 2014/7/22 5:09, Nishanth Aravamudan wrote:
> On 21.07.2014 [12:53:33 -0700], Alexander Duyck wrote:
>> I do agree the description should probably be changed. There shouldn't be
>> any panics involved, only a performance impact as it will be reallocating
>> always if it is on a node with no memory.
>
> Yep, thanks for the review.
>
>> My intention on this was to make certain that the memory used is from the
>> closest node possible. As such I believe this change likely honours that.
>
> Absolutely, just wanted to make it explicit that it's not a functional
> fix, just a performance fix (presuming this shows up at all on systems
> that have memoryless NUMA nodes).
>
> I'd suggest an update to the comments, as well.
>
> Thanks,
> Nish
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-07-23 3:20 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
2014-07-11 7:37 ` [RFC Patch V1 03/30] mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 04/30] mm, netfilter: " Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 10/30] mm, xfrm: " Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 13/30] mm, i40e: " Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 14/30] mm, i40evf: " Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 15/30] mm, igb: " Jiang Liu
2014-07-21 17:42 ` Nishanth Aravamudan
2014-07-21 19:53 ` Alexander Duyck
2014-07-21 21:09 ` Nishanth Aravamudan
2014-07-23 3:20 ` Jiang Liu
2014-07-11 7:37 ` [RFC Patch V1 16/30] mm, ixgbe: " Jiang Liu
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).