From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 976B1A0566; Tue, 10 Mar 2020 17:31:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 026B71BF96; Tue, 10 Mar 2020 17:31:42 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id E865B2BE6 for ; Tue, 10 Mar 2020 17:31:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583857899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hviHuKHX0qInITz6wuV0W+gpFeC0//YQjeglNCtQAIw=; b=WDJJUFC10c+7Hr0b33p1y8FFKLmmBqs1NujclcduVxe5wFtv0UJMoXtznVpMSXcW3vNPNI M529BfaBlPYRCfAhYem7uuYDDIXbACtAM+lSv2Lni8mPHj5N0UZcc6dN3ETUmiX5aP7iLr KZwKrNrY4MLayp3j0ZApftJcOk29LIg= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-lk6XXdv1OkaTJvczkRQZ9w-1; Tue, 10 Mar 2020 12:31:37 -0400 X-MC-Unique: lk6XXdv1OkaTJvczkRQZ9w-1 Received: by mail-vs1-f70.google.com with SMTP id 127so559573vst.17 for ; Tue, 10 Mar 2020 09:31:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X6cT25hleAI4hAkCY1oQ8+UkyeoTYuHl97RCwUZnE0w=; b=YoeD1hPZSdrRaWebU2zdGYETHQ7tRh1M4GmPJNV2yAGn/CA1vFkHOW/GPe5cpc4S4A N8r0mjl8DvI84xLpmMbCJeuiYAG5ag5qW2qbRURJ82lAo3PiAvs3yQiJuOvNR+PDZzQ5 baxMpTXh80boq+X/gaflb5McIgkNhhivnNkDM4ddlJfoT3X0+Bfh8CqbD4xGfpParGJ4 R577zS7Y5rMHdYlPF6DyB1V6pwE96SO8ymaP7rOBgO2TRFvDZiVKoJztIk46Ct0BggmP mYXBQGTBZscvRbbBorxi8feFmgEFKUqPz6cB6PDDY1REIYg0Z1a5uPjc2tfHvE2JcXuL Ebig== X-Gm-Message-State: ANhLgQ2mSh9EPU8JwD9GZnO/V1O2Yu69w+aHvQ/PcZoAi03pc0ZRvuC/ L+ijMpx2ZyYj6NbacE8LI2uYbppXvOhYEJBQ0BrGEau8dpmDdezebxIeesUwkM/JnX2q280v1zY 6bA7+V/QgroNSPeNzzMU= X-Received: by 2002:a05:6102:30ba:: with SMTP id y26mr10882480vsd.198.1583857896651; Tue, 10 Mar 2020 09:31:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtdqLQAWsWXQulCZ7yL8Wp5pNHF8RPxovG5D07jPYGtMnM5ZxYGZMqAQY+QgYBoX8S+3SUxTckzcbZzlZod61I= X-Received: by 2002:a05:6102:30ba:: with SMTP id y26mr10882446vsd.198.1583857896204; Tue, 10 Mar 2020 09:31:36 -0700 (PDT) MIME-Version: 1.0 References: <20200310133304.39951-1-harry.van.haaren@intel.com> In-Reply-To: <20200310133304.39951-1-harry.van.haaren@intel.com> From: David Marchand Date: Tue, 10 Mar 2020 17:31:24 +0100 Message-ID: To: Harry van Haaren Cc: dev , Aaron Conole X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] eal/service: fix exit by resetting service lcores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Mar 10, 2020 at 2:32 PM Harry van Haaren wrote: > > This commit releases all service cores from thier role, > returning them to ROLE_RTE on rte_service_finalize(). > > This may fix an issue relating to the service cores causing > a race-condition on eal_cleanup(), where the service core > could still be executing while the main thread has already > free-d the service memory, leading to a segfault. Adding rte_service_lcore_reset_all() just tells a (remaining) service lcore to quit its loop, but does not close the race on lcore_states. The backtrace shows the same. (gdb) bt full #0 rte_service_runner_func (arg=3D) at ../lib/librte_eal/common/rte_service.c:455 service_mask =3D 1 i =3D lcore =3D 1 cs =3D 0x1003ea200 #1 0x00007ffff72030ef in eal_thread_loop (arg=3D) at ../lib/librte_eal/linux/eal/eal_thread.c:153 fct_arg =3D c =3D 0 '\000' n =3D ret =3D lcore_id =3D thread_id =3D 140737203603200 m2s =3D 14 s2m =3D 22 cpuset =3D "1", '\000' , "\200\000\000\000\000\000\000\000\221\354e\360\377\177", '\000' __func__ =3D "eal_thread_loop" #2 0x00007ffff065ddd5 in start_thread () from /lib64/libpthread.so.0 No symbol table info available. #3 0x00007ffff038702d in clone () from /lib64/libc.so.6 No symbol table info available. I added a rte_eal_mp_wait_lcore(), to ensure that each service lcore _did_ quit its loop. @@ -123,6 +123,7 @@ rte_service_finalize(void) return; rte_service_lcore_reset_all(); + rte_eal_mp_wait_lcore(); rte_free(rte_services); rte_free(lcore_states); I can't reproduce with this. -- David Marchand