[v2] malloc: fix duplicate mem event notification

Message ID 4934d38eb70f2951f9212bd4d7e35ceb9d982321.1544546857.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] malloc: fix duplicate mem event notification |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Burakov, Anatoly Dec. 11, 2018, 4:48 p.m. UTC
  We already trigger a mem event notification inside the walk function,
no need to do it twice.

Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---

Notes:
    v2:
    - Fixed code style

 lib/librte_eal/common/rte_malloc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Comments

Thomas Monjalon Dec. 20, 2018, 2:29 p.m. UTC | #1
11/12/2018 17:48, Anatoly Burakov:
> We already trigger a mem event notification inside the walk function,
> no need to do it twice.
> 
> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 0da5ad5e8..5f07b981a 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -517,13 +517,8 @@  sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach)
 	if (wa.result < 0) {
 		rte_errno = -wa.result;
 		ret = -1;
-	} else {
-		/* notify all subscribers that a new memory area was added */
-		if (attach)
-			eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC,
-					va_addr, len);
+	} else
 		ret = 0;
-	}
 unlock:
 	rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
 	return ret;