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 3B251A0032; Fri, 21 Oct 2022 15:10:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2ED4142C22; Fri, 21 Oct 2022 15:10:26 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4B7F242B9C for ; Fri, 21 Oct 2022 15:10:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666357824; 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: in-reply-to:in-reply-to:references:references; bh=e0AHF323nVTeir/nUDT4vCCH0g2uR46lzbAm2cKosIc=; b=G8LLAVCbgWN1nvXUfxAuIziFB5naSG0yxBcyuh1oWHEA7szrt661Jn/wV3exyLVUKgcZaj cevUQlKnRdLaN+GIldh4stYL01sQ5W0QK+uFVLjVgAhrPS/uTEfismbJKGEcKmzg/dqKzj k0n7u1+Tyx+Vi7LCat48UFEIVqR9Ot0= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-240-2NY6s3mDOu-2z9oPz-kvBA-1; Fri, 21 Oct 2022 09:10:23 -0400 X-MC-Unique: 2NY6s3mDOu-2z9oPz-kvBA-1 Received: by mail-pf1-f199.google.com with SMTP id cv12-20020a056a0044cc00b00562f6351e09so1378744pfb.3 for ; Fri, 21 Oct 2022 06:10:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e0AHF323nVTeir/nUDT4vCCH0g2uR46lzbAm2cKosIc=; b=MttvHB/5BVp4PzGQzlBLnMCS9WQsnws4RwjniX7klVLe1vE6MF6jdE6KYmTHWeDkMT gbUDU5hXtoewM/XNCWYDHvNVpXxrPPsU6rOD7qAJBLQEG0RFZgASlfExrt06+Qx0JPJ0 ib+aB0r1O4pbsCGxdAOjyLsmGHrDLoif1v9Cx6FhmdEUIkDYFnsYPompbJcG0V87oASL FMKvfkG4XmdVqKE+y7fU5TceeFWzXqMw4P9oD4IP+sXty9UlT8ziKuDCbt4Sx6y0tHgB 7DV1VwPUgANvajqW7oL6cdo6T96Rlv30SDNOWfQ1W6vKUv9wjvvB67jGRimOYUDwTSNP qUAg== X-Gm-Message-State: ACrzQf3dQIa7h9ogeht8xKyFsq6h60ErL5JFrmpehX/GKoZjk2T1UsVT crw23UOhzmDQcQh6Q5Mb5x55c11PkWSSJSWj7GdRsWlnFn/kLaDfoDrZgNHAbkMhuxbRWNwD03a N/5ILXYMgITzhknPy1Go= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr18579932plh.172.1666357821932; Fri, 21 Oct 2022 06:10:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IYFx27sVRU9Bu+cBKnpf2IXwFy926AMSqA4hmEmDOA0DzvqqGh8bo6I4OT37wafXljrajobnFZlcWXDhkJoY= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr18579912plh.172.1666357821687; Fri, 21 Oct 2022 06:10:21 -0700 (PDT) MIME-Version: 1.0 References: <20221020190041.2350842-1-erik.g.carrillo@intel.com> In-Reply-To: From: David Marchand Date: Fri, 21 Oct 2022 15:10:10 +0200 Message-ID: Subject: Re: [PATCH] service: fix early move to inactive status To: "Carrillo, Erik G" Cc: "Van Haaren, Harry" , "Naga Harish K, S V" , "dev@dpdk.org" , "stable@dpdk.org" , "thomas@monjalon.net" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Fri, Oct 21, 2022 at 1:36 PM Van Haaren, Harry wrote: > > > > Assume thread T2 is a service lcore that is in the middle of executing > > a service function. Also, assume thread T1 concurrently calls > > rte_service_lcore_stop(), which will set the "service_active_on_lcore" > > state to false. If thread T1 then calls rte_service_may_be_active(), > > it can return zero even though T2 is still running the service function. > > If T1 then proceeds to free data being used by T2, a crash can ensue. > > > > Move the logic that clears the "service_active_on_lcore" state from the > > rte_service_lcore_stop() function to the service_runner_func() to > > ensure that we: > > - don't let the "service_active_on_lcore" state linger as 1 > > - don't clear the state early > > > > Fixes: 6550113be62d ("service: fix lingering active status") > > Cc: stable@dpdk.org > > > > Signed-off-by: Erik Gabriel Carrillo > Acked-by: Harry van Haaren Applied, thanks. -- David Marchand