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 319EA41E06; Tue, 7 Mar 2023 14:53:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9BDC40EDB; Tue, 7 Mar 2023 14:53:49 +0100 (CET) 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 3C8184067B for ; Tue, 7 Mar 2023 14:53:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678197228; 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=LBp1PZQxSvedTZSB6XtpgskP9ulrNvXuidQBKxlnlZU=; b=QT39y/RGP+FrW6m6VkQWzUnK0V7DiSt6AtICAbijym8nBA22U+LwVSGP3+5pOM461QvG+Z Nf+Mga7wFihWzQ+bDN4zkkl3wtpvk4TislZwvGtrxiP0zS+6LqrkQ/UiFAxEDYoSSA929j 3QU6s43foigggol186NHpik+buYnkf0= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-oOTGjrRFNIuY2OLOQS77uw-1; Tue, 07 Mar 2023 08:53:47 -0500 X-MC-Unique: oOTGjrRFNIuY2OLOQS77uw-1 Received: by mail-pj1-f70.google.com with SMTP id x63-20020a17090a6c4500b00237731465feso5081742pjj.8 for ; Tue, 07 Mar 2023 05:53:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678197226; h=content-transfer-encoding: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=LBp1PZQxSvedTZSB6XtpgskP9ulrNvXuidQBKxlnlZU=; b=cJs7Va5Yc03AzI67g/1bJ08olav2JrzvtHhWQygYP15b86z6603nj7RYuu6HNWuKBL g2UAFr0GiNoPprrTWXludhdY3OOkKUHPww5PFu9nBYuXE6btWsEBeyBRExq6B9wsMoQ1 1kDKSPVglSpdzucLQBphndHqvy8MoCnBWKZbOAo/2SstTr7vU+t/kwkKuicQRXHY0Kwm q1gC8R/Lj/A1//onLdj1w9tCLr3qhOvOK7GbkXzICuRLidcX3AUefxXuWoxnBcBliWzm CViKN+pZaM6yCSjQvAUASwrqa32EICh4Admi6slnEKGdmlrcIK7TKwfcnTCjgBmJa/Jd /7aw== X-Gm-Message-State: AO0yUKVuWnWNYdzSxrbFhZRLMSVOMba3flPULtvAmOQPSs+d89JyAlU9 a0K0jAfIoRQTabKdRAYp/HhCBvZyfnbwgVo6UJ3OsaCK0N1LasBVNIonc4EtqQF+3L+PcERFfrM Z4ymv6PTiAamYpn5h0mI= X-Received: by 2002:a17:903:258f:b0:19a:98ea:5ef1 with SMTP id jb15-20020a170903258f00b0019a98ea5ef1mr5659451plb.13.1678197226631; Tue, 07 Mar 2023 05:53:46 -0800 (PST) X-Google-Smtp-Source: AK7set8GQqDZYD1RPG0qQW7zYbX+W/2n6PHHdGQoQd36/8NEWPnJH64l8tss/LU3bOObfT0hJqA8B3Rez7hwXxmloLE= X-Received: by 2002:a17:903:258f:b0:19a:98ea:5ef1 with SMTP id jb15-20020a170903258f00b0019a98ea5ef1mr5659438plb.13.1678197226121; Tue, 07 Mar 2023 05:53:46 -0800 (PST) MIME-Version: 1.0 References: <1677518230-1194-1-git-send-email-roretzla@linux.microsoft.com> <1677704982-2643-1-git-send-email-roretzla@linux.microsoft.com> <20230302014558.GA9271@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: From: David Marchand Date: Tue, 7 Mar 2023 14:53:34 +0100 Message-ID: Subject: Re: [PATCH v2] eal: fix thread race in control thread creation To: Honnappa Nagarahalli , Tyler Retzlaff Cc: "dev@dpdk.org" , "thomas@monjalon.net" , nd X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Thu, Mar 2, 2023 at 5:18=E2=80=AFAM Honnappa Nagarahalli wrote: > > > > if (ctrl_thread_init(arg) !=3D 0) > > > > return NULL; > > > > > > > > - return start_routine(params->arg); > > > > + return start_routine(start_arg); > > > We can free 'params' here after 'start_routine' returns. > > > > I guess it doesn't matter if the allocation is retained for the duratio= n of > > start_routine() which could be ~long. > Yes, that's what I thought, it is a small size. > > > > > David/Honnappah let me know what you decide. if you'd prefer to change = to > > honnappah's suggestion i'll put a new version up. Hum, how would it look like? - the parent thread would free params if the child thread fails to set affi= nity, - the child thread would free params otherwise, Is this what you propose? This works, but we have to be extra careful if any change is done in this part later. --=20 David Marchand