From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 4E8FAA0679
	for <public@inbox.dpdk.org>; Mon,  1 Apr 2019 16:22:39 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 161A14C95;
	Mon,  1 Apr 2019 16:22:39 +0200 (CEST)
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 38FC2343C;
 Mon,  1 Apr 2019 16:22:35 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 01 Apr 2019 07:22:34 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,296,1549958400"; d="scan'208";a="219485899"
Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204])
 by orsmga001.jf.intel.com with ESMTP; 01 Apr 2019 07:22:33 -0700
Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by
 FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Mon, 1 Apr 2019 07:22:33 -0700
Received: from hasmsx114.ger.corp.intel.com (10.184.198.65) by
 FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Mon, 1 Apr 2019 07:22:33 -0700
Received: from hasmsx105.ger.corp.intel.com ([169.254.1.16]) by
 HASMSX114.ger.corp.intel.com ([169.254.14.210]) with mapi id 14.03.0415.000;
 Mon, 1 Apr 2019 17:22:30 +0300
From: "Stojaczyk, Dariusz" <dariusz.stojaczyk@intel.com>
To: 'Thomas Monjalon' <thomas@monjalon.net>
CC: "'dev@dpdk.org'" <dev@dpdk.org>, "Zhang, Qi Z" <qi.z.zhang@intel.com>,
 "Burakov, Anatoly" <anatoly.burakov@intel.com>, "'stable@dpdk.org'"
 <stable@dpdk.org>, "Richardson, Bruce" <bruce.richardson@intel.com>
Thread-Topic: [dpdk-dev] [PATCH] eal: initialize alarms early
Thread-Index: AQHU5APjFsFLn9yHZE2TJ9K2xhb7EqYfp3+AgABCsiCAB3nwwA==
Date: Mon, 1 Apr 2019 14:22:30 +0000
Message-ID: <FBE7E039FA50BF47A673AD0BD3CD56A8462F5FF8@HASMSX105.ger.corp.intel.com>
References: <20190326184331.13850-1-dariusz.stojaczyk@intel.com>
 <2545420.xP4CxeWPSp@xps>
 <FBE7E039FA50BF47A673AD0BD3CD56A8462F2787@HASMSX105.ger.corp.intel.com>
In-Reply-To: <FBE7E039FA50BF47A673AD0BD3CD56A8462F2787@HASMSX105.ger.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-version: 11.0.400.15
dlp-reaction: no-action
x-originating-ip: [10.102.11.60]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal: initialize alarms early
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>



> -----Original Message-----
> From: Stojaczyk, Dariusz
> Sent: Wednesday, March 27, 2019 9:34 PM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Burakov, Anatoly
> <anatoly.burakov@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] eal: initialize alarms early
>=20
>=20
>=20
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Wednesday, March 27, 2019 7:12 PM
> > To: Stojaczyk, Dariusz <dariusz.stojaczyk@intel.com>
> > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Burakov, Anatoly
> > <anatoly.burakov@intel.com>; stable@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] eal: initialize alarms early
> >
> > 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.
>=20
> Hah, ok - I'll check again the possible outcomes of this.
>=20

Done, I can't see any case I could break.

> >
> > > Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
> > > Cc: Qi Zhang <qi.z.zhang@intel.com>
> > > Cc: Anatoly Burakov <anatoly.burakov@intel.com>
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
> > > ---
> > >  lib/librte_eal/linux/eal/eal.c | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > You probably need to update the FreeBSD version too.
> >
>=20
> 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.

Basing on Anatoly's feedback, I pushed a v2 with bsd changes
included as well.

Thanks!
D.

>=20
> D.