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 64AB241E06; Tue, 7 Mar 2023 18:54:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0873C40ED6; Tue, 7 Mar 2023 18:54:03 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 278834067B for ; Tue, 7 Mar 2023 18:54:01 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6395B20C14D7; Tue, 7 Mar 2023 09:54:00 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6395B20C14D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678211640; bh=XBpwPaW8qqjcjgh686dHBHVFeFq/Vryd82lcflW51xo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aOZ2ViSRshelbSspmf1vjID/FREwJLZpiurpia8enaMG4CcYIQoFM2oNthwPxjOdE WkTp1MtWZ+WKNjVwBxC+x01dI0IjjWNbRqynxUXnyd9YPVTiDaDqTQrf3MyhlTsHvW edWHBelC6+FWWWSQ7J0CNM8jDs/pES+zQoSxME38= Date: Tue, 7 Mar 2023 09:54:00 -0800 From: Tyler Retzlaff To: David Marchand Cc: Honnappa Nagarahalli , "dev@dpdk.org" , "thomas@monjalon.net" , nd Subject: Re: [PATCH v2] eal: fix thread race in control thread creation Message-ID: <20230307175400.GA23718@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 Tue, Mar 07, 2023 at 02:53:34PM +0100, David Marchand wrote: > On Thu, Mar 2, 2023 at 5:18 AM Honnappa Nagarahalli > wrote: > > > > > if (ctrl_thread_init(arg) != 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 duration 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 affinity, > - 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. i think the fix i've already put up is kind of trivially verifiable as correct, if we just need a fix then it works. > > > -- > David Marchand