From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D16D95B20; Thu, 28 Mar 2019 14:14:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 06:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,280,1549958400"; d="scan'208";a="159218349" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.103]) ([10.237.220.103]) by fmsmga001.fm.intel.com with ESMTP; 28 Mar 2019 06:14:38 -0700 To: Thomas Monjalon , Bruce Richardson Cc: "Stojaczyk, Dariusz" , "dev@dpdk.org" , "Zhang, Qi Z" , "stable@dpdk.org" References: <20190326184331.13850-1-dariusz.stojaczyk@intel.com> <1752426.1oQredii45@xps> <20190328104313.GA1418@bricha3-MOBL.ger.corp.intel.com> <2018712.ubzJDVHxhL@xps> From: "Burakov, Anatoly" Message-ID: Date: Thu, 28 Mar 2019 13:14:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <2018712.ubzJDVHxhL@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: initialize alarms early 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: , X-List-Received-Date: Thu, 28 Mar 2019 13:14:41 -0000 On 28-Mar-19 10:46 AM, Thomas Monjalon wrote: > 28/03/2019 11:43, Bruce Richardson: >> On Wed, Mar 27, 2019 at 11:42:40PM +0100, Thomas Monjalon wrote: >>> 27/03/2019 21:33, Stojaczyk, Dariusz: >>>> From: Thomas Monjalon [mailto:thomas@monjalon.net] >>>>> 26/03/2019 19:43, Darek Stojaczyk: >>>>>> We currently initialize rte_alarms after starting >>>>>> to listen for IPC hotplug requests, which gives >>>>>> us a data race window. Upon receiving such hotplug >>>>>> request we always try to set an alarm and this >>>>>> obviously doesn't work if the alarms weren't >>>>>> initialized yet. >>>>>> >>>>>> To fix it, we initialize alarms before starting >>>>>> to listen for IPC hotplug messages. Specifically, >>>>>> we move rte_eal_alarm_init() right after >>>>>> rte_eal_intr_init() as it makes some sense to >>>>>> keep those two close to each other. >>>>> >>>>> I wonder which regression it will bring :) >>>>> The experience shows that we cannot touch this function >>>>> without introducing a regression. Please check twice. >>>> >>>> Hah, ok - I'll check again the possible outcomes of this. >>>> >>>>> >>>>>> Fixes: 244d5130719c ("eal: enable hotplug on multi-process") >>>>>> Cc: Qi Zhang >>>>>> Cc: Anatoly Burakov >>>>>> Cc: stable@dpdk.org >>>>>> >>>>>> Signed-off-by: Darek Stojaczyk >>>>>> --- >>>>>> lib/librte_eal/linux/eal/eal.c | 12 ++++++------ >>>>>> 1 file changed, 6 insertions(+), 6 deletions(-) >>>>> >>>>> You probably need to update the FreeBSD version too. >>>>> >>>> >>>> Oh, that I cannot do. First of all, in bsd code I don't see >>>> rte_mp_dev_hotplug_init() called anywhere, as if bsd >>>> did not listen for IPC hotplug messages at all and hence did >>>> not have any data race in this area. Second, I would be >>>> afraid to touch any bsd code as I'm not running any bsd >>>> system. >>> >>> The problem is the consistency between OSes. >>> May you ask help here? Bruce is maintaining the FreeBSD side. >>> >> I don't think we support IPC or hotplug on BSD, so I don't think this patch >> is relevant on the BSD side. > > Yes, but then, the initialization order is different on Linux and BSD. > I'm thinking about consistency and maintenance ease. > From my cursory inspection, nothing should be broken on FreeBSD as a result of moving alarm API init earlier. -- Thanks, Anatoly From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A124DA0679 for ; Thu, 28 Mar 2019 14:14:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C93B1B201; Thu, 28 Mar 2019 14:14:42 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D16D95B20; Thu, 28 Mar 2019 14:14:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 06:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,280,1549958400"; d="scan'208";a="159218349" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.103]) ([10.237.220.103]) by fmsmga001.fm.intel.com with ESMTP; 28 Mar 2019 06:14:38 -0700 To: Thomas Monjalon , Bruce Richardson Cc: "Stojaczyk, Dariusz" , "dev@dpdk.org" , "Zhang, Qi Z" , "stable@dpdk.org" References: <20190326184331.13850-1-dariusz.stojaczyk@intel.com> <1752426.1oQredii45@xps> <20190328104313.GA1418@bricha3-MOBL.ger.corp.intel.com> <2018712.ubzJDVHxhL@xps> From: "Burakov, Anatoly" Message-ID: Date: Thu, 28 Mar 2019 13:14:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <2018712.ubzJDVHxhL@xps> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: initialize alarms early 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" Message-ID: <20190328131437.WEipepE5XbUJpCZccvP-x8WSQVwIh2Szl5xcqb9RSmY@z> On 28-Mar-19 10:46 AM, Thomas Monjalon wrote: > 28/03/2019 11:43, Bruce Richardson: >> On Wed, Mar 27, 2019 at 11:42:40PM +0100, Thomas Monjalon wrote: >>> 27/03/2019 21:33, Stojaczyk, Dariusz: >>>> From: Thomas Monjalon [mailto:thomas@monjalon.net] >>>>> 26/03/2019 19:43, Darek Stojaczyk: >>>>>> We currently initialize rte_alarms after starting >>>>>> to listen for IPC hotplug requests, which gives >>>>>> us a data race window. Upon receiving such hotplug >>>>>> request we always try to set an alarm and this >>>>>> obviously doesn't work if the alarms weren't >>>>>> initialized yet. >>>>>> >>>>>> To fix it, we initialize alarms before starting >>>>>> to listen for IPC hotplug messages. Specifically, >>>>>> we move rte_eal_alarm_init() right after >>>>>> rte_eal_intr_init() as it makes some sense to >>>>>> keep those two close to each other. >>>>> >>>>> I wonder which regression it will bring :) >>>>> The experience shows that we cannot touch this function >>>>> without introducing a regression. Please check twice. >>>> >>>> Hah, ok - I'll check again the possible outcomes of this. >>>> >>>>> >>>>>> Fixes: 244d5130719c ("eal: enable hotplug on multi-process") >>>>>> Cc: Qi Zhang >>>>>> Cc: Anatoly Burakov >>>>>> Cc: stable@dpdk.org >>>>>> >>>>>> Signed-off-by: Darek Stojaczyk >>>>>> --- >>>>>> lib/librte_eal/linux/eal/eal.c | 12 ++++++------ >>>>>> 1 file changed, 6 insertions(+), 6 deletions(-) >>>>> >>>>> You probably need to update the FreeBSD version too. >>>>> >>>> >>>> Oh, that I cannot do. First of all, in bsd code I don't see >>>> rte_mp_dev_hotplug_init() called anywhere, as if bsd >>>> did not listen for IPC hotplug messages at all and hence did >>>> not have any data race in this area. Second, I would be >>>> afraid to touch any bsd code as I'm not running any bsd >>>> system. >>> >>> The problem is the consistency between OSes. >>> May you ask help here? Bruce is maintaining the FreeBSD side. >>> >> I don't think we support IPC or hotplug on BSD, so I don't think this patch >> is relevant on the BSD side. > > Yes, but then, the initialization order is different on Linux and BSD. > I'm thinking about consistency and maintenance ease. > From my cursory inspection, nothing should be broken on FreeBSD as a result of moving alarm API init earlier. -- Thanks, Anatoly