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 DB1B441C51; Thu, 9 Feb 2023 13:45:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6CA74067B; Thu, 9 Feb 2023 13:45:52 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id D8BC2400D5 for ; Thu, 9 Feb 2023 13:45:51 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id b5so2670875plz.5 for ; Thu, 09 Feb 2023 04:45:51 -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=dwLdnG+sIxGdtY2Ma/j8CfKRHC9kGtt9/1iZrZ95ZUwJ/IXWGcaoqNSE1DiMAOmsMO vfP0TMu7h89beoXz79J/C/JeVtLSSPR0Cj/4Cq/oFHrzy5j2Iwo5LDzGzkZQX6THIxgp jpdzTxQ/B47Z6dPCnn3DPPC448VcROzGGPPASGN6FiPOI1zdVWZDYQaP/KJr90oBQ6CG h0oY5hjzpbWWZrDqM//Wvbe7Adtnv5s8zoRBTnlD0UOyr9Kqv5+U9Z7q3ryTCEbqtFCu Hbr44JrZmODfgHWMIos2wbtzHcqSNSX1h7/8ZTgM7LqLCJkXRBsbp3vqQvJ5MB/z7Kzw +0YQ== 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=XA7WqfJvwNqzQpEnuyMfLRDziR/WlOoOod7xBqp2XxcbzapROnDW0I1rEdt49WqVnK ese3NJJ3Wrc24jKDdXNc6etMRPZl+dY5pnK7Ahd0S5AAay+MTwnVtou/X1MMbH44/d/J cqU0tMGGh990JZnDBLn2Sh4XtJA0yJlKTLrkIf7ooOorIjlACjiPl3sM1Igxx+5sNMvc TN6FcxBW/eVp41mbq2U0uZl/MqSVkOqER5Q6zl6C+cKhBjTdd4qJlm7aeybAC1hRCKgl BFUn0Flys8DQYwk1maUegYAQ13Za3kmiplNPXPEpu1VlxZDCsQhE58mRBxPJN6doV50A PeNQ== X-Gm-Message-State: AO0yUKW6d0FBDObzB/k9OCyc2oj7uffQn3GHLF02IC+S43dIzGCDBtvk ZmKi9GCnClO1XY6tzlPTZXQHMA== X-Google-Smtp-Source: AK7set+88YNfh/+QedmzA+ADkGAHzUnQ42/Ei9wrEQCZS5qLom9lKJqdxvaVJV2XxemC/VR2+N7zdA== X-Received: by 2002:a17:903:32c6:b0:196:1cc3:74fc with SMTP id i6-20020a17090332c600b001961cc374fcmr11994358plr.4.1675946751139; Thu, 09 Feb 2023 04:45:51 -0800 (PST) Received: from HTW5T2C6VL.bytedance.net ([2404:9dc0:cd01::9]) by smtp.gmail.com with ESMTPSA id ix20-20020a170902f81400b00192d3e7eb8fsm1376245plb.252.2023.02.09.04.45.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 09 Feb 2023 04:45:50 -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:45:43 +0800 Message-Id: <20230209124543.83652-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-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)