From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FEDF41C89; Mon, 13 Feb 2023 15:11:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B816F42D0C; Mon, 13 Feb 2023 15:11:32 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 6A286400D5 for ; Thu, 9 Feb 2023 13:03:36 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id u9so2573571plf.3 for ; Thu, 09 Feb 2023 04:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UNxD2hn4Q4bpmR7GjeMZFPTOz2aG+2+tnDuwTdtyOE4=; b=qNSUbxTtK4fhlm3idQn3QExpzI5hyeIEx8qdMAgXiRY5QS+naJ2WwbNxK0Kfu6ROMY o12T/uMK1Clcdmao3LOy93UudziTL9k9rBl/IPY6v7JZ7ColiwX5C5xEtIMetxlGkPeK l4APl1n5Ptuy+0uW7LFDfpgqOiWimrnyngLCOLzUHxBqzwZhBwxxI/JNGxDgNI3puDnN BzooJdVKAtiUPTxmobWssvzdY+kYD1j5bAj8pYIj3RQgnP/jcagoZkiAq22cQmNOU7CD aGbkxJkNIBVaMtx/X2rGVPZiGRJK0zyoEb0jOz5YonaO2KOOmzZbU3kEMtQwpTwfjBU+ cUtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UNxD2hn4Q4bpmR7GjeMZFPTOz2aG+2+tnDuwTdtyOE4=; b=sNPLQ1SDkNaHO+JbMpEHYflB7jmjRTcD4GIj7Z9slGphd2TUDhuK9IzulXWfBJAsxN DPW+Khz4p+CVz2jWXOj0Lg8CWF368bPPcks06kvPzG+IeP35apTrni8nniTnMfuX25t1 SKkPM3B+28MhG9fns0O7IEEPPIc+AFB55rpdnmoRYFqQ68ODsC1H1nMIhI87W9luAaEM zosuZaHyKX+gYuCaX8n9dtL0sRWcS+E5rL2EX6AvEBPAJNd/Hna5xS07bEs3uUEox/s9 YVvyBHFtcOQDjgwCFOql3dqQBNw0+RNHI+YOHl1yidMqQTFCukxBWCST97OPDsXUyyjY 5fZg== X-Gm-Message-State: AO0yUKVqAZ4cAeDRvj40KPblzeY3b7+lbayV0du6UQgga+RUX52vGEMa kewzuDKF0SPwnVRPVu+vx/CJXA== X-Google-Smtp-Source: AK7set8h/smhXkDlMKN3cTPVLhy6KQ4ntiphta5bVZss3+vUCbGZWaEEmpjUEEbpmcosGm9FwklTIQ== X-Received: by 2002:a17:902:ced2:b0:196:4d17:2f51 with SMTP id d18-20020a170902ced200b001964d172f51mr12031233plg.5.1675944215490; Thu, 09 Feb 2023 04:03:35 -0800 (PST) Received: from HTW5T2C6VL.bytedance.net ([139.177.225.231]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d88500b00196896d6d04sm1296889plz.258.2023.02.09.04.03.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 09 Feb 2023 04:03:35 -0800 (PST) From: Fengnan Chang To: thomas@monjalon.net, david.marchand@redhat.com Cc: dev@dpdk.org, Fengnan Chang Subject: [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach Date: Thu, 9 Feb 2023 20:03:26 +0800 Message-Id: <20230209120326.77938-1-changfengnan@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20221213075938.36964-1-changfengnan@bytedance.com> References: <20221213075938.36964-1-changfengnan@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 13 Feb 2023 15:11:29 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Alarm and multiprocess hotplug still need access hugepage memory, if alarm event processed after memory detach, it may cause SEGV. So cleanup alarm and multiprocess hotplug before memory detach. Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle") Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources") Signed-off-by: Fengnan Chang --- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 1b58cd3da6..83b99c601f 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -897,9 +897,9 @@ rte_eal_cleanup(void) eal_bus_cleanup(); rte_trace_save(); eal_trace_fini(); + rte_eal_alarm_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); - rte_eal_alarm_cleanup(); eal_cleanup_config(internal_conf); return 0; } diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 8c118d0d9f..c76f026023 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1372,11 +1372,11 @@ rte_eal_cleanup(void) eal_bus_cleanup(); rte_trace_save(); eal_trace_fini(); + eal_mp_dev_hotplug_cleanup(); + rte_eal_alarm_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); - eal_mp_dev_hotplug_cleanup(); rte_eal_malloc_heap_cleanup(); - rte_eal_alarm_cleanup(); eal_cleanup_config(internal_conf); rte_eal_log_cleanup(); return 0; -- 2.37.0 (Apple Git-136)