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 508ADA034C; Wed, 21 Dec 2022 11:19:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07B6A42D5C; Wed, 21 Dec 2022 11:18:12 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id B757640684 for ; Wed, 21 Dec 2022 04:42:00 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id v3so9620731pgh.4 for ; Tue, 20 Dec 2022 19:42:00 -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:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UNxD2hn4Q4bpmR7GjeMZFPTOz2aG+2+tnDuwTdtyOE4=; b=VhYx3TK/PsYarz44x0BC3nFzeclq1sGsAREdSfSnUxqWIlpn6pTaqArFs2D5xDyuT/ avMfJEeUuVCrDPmjD9le3p0DIc+Gn4rXwRxxr9Yma7rfUYr/WiBsFVXYR7frDZOVqAXN K28cR8iE97jgvl7sDOZQ4QtECu4K/p1VsQ99yyVsTdfjX2XjoNTlUILgms0NVDXlEevw TelVAzaCBoXcQgAND+6ysNFQPuZUBmJYrHwNTZ16g1a6iNd3W7iOqB3VOOB3sQjn3L6p x/3tRUASVLgJ30vQEI5390YkomPbs/0Fc4Ik/r9oJkyHXo2BTEnfIeB7Uz58pkVVljgv /Abw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version: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=MkuvrwKqQMGHphOTw/GXw87FmpQ4D/tk2TIsamChbSg6A9m3o1jB3rWbISicYZDwF5 6RIsUV5TXwQQVRLHg1yXJ9GNrX/am0bLfO5YnyPOFgcWxwFntGkTNwv83Z+bYYA+24Wl skQZRSr2yAAloUZHKQEDucMh/AusXNjfo7Ko254kVMpe5gj67UpFyzBYo2s4vpZRJkvk IhkjYpttfsmlkGPR07nCkkushNe8rRVzH6we6chlxnDemxPXOti5CM3W1eKlKP+uUM1I cD9HqlbJGVL68nCtV6PgyvYMj1VT4t6rEWRdek7TNDplK3IzeYGhw0PoFAU7f8xhs3aI hMIg== X-Gm-Message-State: AFqh2kovcdj3eEKfZbZQcdJ9fk53b6LmxS0nrvldOS7kFa2kxQB7SJTI hGqzZkkBVFBATvkaHECL9vQGiA== X-Google-Smtp-Source: AMrXdXtc5aoU5eAG4w2jwWpqzDupmdIimCNuu183CWm9MWa59pZdmA63IRjArcukc4E4HkMkKdYR9Q== X-Received: by 2002:a05:6a00:1c88:b0:578:451c:84a9 with SMTP id y8-20020a056a001c8800b00578451c84a9mr192185pfw.2.1671594119517; Tue, 20 Dec 2022 19:41:59 -0800 (PST) Received: from HTW5T2C6VL.bytedance.net ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id 74-20020a62194d000000b0056bc742d21esm9637115pfz.176.2022.12.20.19.41.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 20 Dec 2022 19:41:59 -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: Wed, 21 Dec 2022 11:41:52 +0800 Message-Id: <20221221034152.30628-1-changfengnan@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 21 Dec 2022 11:17:53 +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)