From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A308668FD for ; Tue, 30 Sep 2014 13:06:41 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 30 Sep 2014 04:03:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="393507398" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by FMSMGA003.fm.intel.com with ESMTP; 30 Sep 2014 04:07:02 -0700 Received: from irsmsx109.ger.corp.intel.com (163.33.3.23) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 30 Sep 2014 12:13:18 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.200]) by IRSMSX109.ger.corp.intel.com ([169.254.13.253]) with mapi id 14.03.0195.001; Tue, 30 Sep 2014 12:13:18 +0100 From: "Wodkowski, PawelX" To: "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe: Thread-Index: AQHP2MAapayPUkT5UUGj9XqXyFJ3T5wR4sKAgAAPjwCAABZmAIAAZLsAgADPUACAAB2vsIAAAhgAgAAUZmCAAAJtAIAACzAAgAALEACAAB2GAIAAGaqAgALq0gCAAE0RAIAAsPTwgAApkQCAABD+IP//+xeAgAGiIxA= Date: Tue, 30 Sep 2014 11:13:18 +0000 Message-ID: References: <20140926150156.GB5619@hmsreliant.think-freely.org> <2601191342CEEE43887BDE71AB9772582137D88E@IRSMSX104.ger.corp.intel.com> <20140926162134.GE5619@hmsreliant.think-freely.org> <2601191342CEEE43887BDE71AB9772582137D95F@IRSMSX104.ger.corp.intel.com> <20140926193905.GH5619@hmsreliant.think-freely.org> <2601191342CEEE43887BDE71AB9772582138410B@IRSMSX104.ger.corp.intel.com> <20140928204754.GC4012@localhost.localdomain> <2601191342CEEE43887BDE71AB977258213874C5@IRSMSX104.ger.corp.intel.com> <20140929103315.GB12072@BRICHA3-MOBL> In-Reply-To: <20140929103315.GB12072@BRICHA3-MOBL> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 11:06:42 -0000 Pawe=B3 > -----Original Message----- > From: Richardson, Bruce > Sent: Monday, September 29, 2014 12:33 > To: Wodkowski, PawelX > Cc: Ananyev, Konstantin; Neil Horman; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread= - > safe: >=20 > On Mon, Sep 29, 2014 at 10:11:38AM +0000, Wodkowski, PawelX wrote: > > > > > > > > Image how you will be damned by someone that not even notice you > change > > > > and he Is managing some kind of resource based on returned number o= f > > > > set/canceled timers. If you suddenly start returning negative value= s how > those > > > > application will behave? Silently changing returned value domain is= evil in > its > > > > pure form. > > > > > > As I can see the impact is very limited. > > > > It is small impact to DPDK but can be huge to user application: >=20 > This is why we traditionally have in the release-notes for each release a > section dedicated to calling out changes from one release to another. [Se= e > http://dpdk.org/doc/intel/dpdk-release-notes-1.7.0.pdf section 5]. Since > from release-to-release there are generally only a couple of changes - > though our next release may be a little different - the actual changes ar= e > clear enough to read about without wading through pages of documentation.= I > thinking calling out the change in both the release notes and the API doc= s > is sufficient even for a change like this. >=20 > Basically, I wouldn't let API stability factor in too much in trying to g= et > a proper fix for this issue. >=20 > /Bruce >=20 Summarizing all proposed solutions and to be able to produce final patch - = what Is desired behavior after fix? 1. do we leave as is in Patch v2: 1.1 if canceling from other thread - if one of the alarms is executing, wai= t to=20 finish its execution and then cancel any rearmed alarms. 1.2 if canceling from alarm handler and one of the alarms to cancel is this= =20 executing callback do no wait for it to finish and cancel anything else. =20 in both cases return number of canceled callbacks. 2. Do exactly like in 1. but return -EINPROGRESS instead of canceled alarms if one of the alarms to cancel is currently executing callback from alarm= thread (information about number of canceled alarms will be lost). 3. refuse to cancel anything if canceling currently executing alarm from al= arm=20 callback and return -EINPROGRESS otherwise do like in 1.1. 4. Implement behaviour 1/2/3 (which?) and add API call to interrogate list = of alarms and retrun state of given alarms(s). 5. other solutions? Pawel