From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D220F2C12; Tue, 11 Dec 2018 17:48:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 08:48:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,342,1539673200"; d="scan'208";a="108717796" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga008.fm.intel.com with ESMTP; 11 Dec 2018 08:48:28 -0800 Received: from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com [10.243.17.64]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wBBGmSI7026944; Tue, 11 Dec 2018 16:48:28 GMT Received: from sivswdev05.ir.intel.com (localhost [127.0.0.1]) by sivswdev05.ir.intel.com with ESMTP id wBBGmSjV008195; Tue, 11 Dec 2018 16:48:28 GMT Received: (from aburakov@localhost) by sivswdev05.ir.intel.com with LOCAL id wBBGmSKN008191; Tue, 11 Dec 2018 16:48:28 GMT From: Anatoly Burakov To: dev@dpdk.org Cc: keith.wiles@intel.com, stable@dpdk.org Date: Tue, 11 Dec 2018 16:48:28 +0000 Message-Id: <4934d38eb70f2951f9212bd4d7e35ceb9d982321.1544546857.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-stable] [PATCH v2] malloc: fix duplicate mem event notification X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 16:48:31 -0000 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 --- Notes: v2: - Fixed code style lib/librte_eal/common/rte_malloc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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; -- 2.17.1