From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A2C0B71 for ; Mon, 29 Sep 2014 12:05:21 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 29 Sep 2014 03:11:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,619,1406617200"; d="scan'208";a="598201528" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 29 Sep 2014 03:11:55 -0700 Received: from irsmsx107.ger.corp.intel.com (163.33.3.99) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 29 Sep 2014 11:11:38 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.200]) by IRSMSX107.ger.corp.intel.com ([169.254.10.68]) with mapi id 14.03.0195.001; Mon, 29 Sep 2014 11:11:38 +0100 From: "Wodkowski, PawelX" To: "Ananyev, Konstantin" , Neil Horman Thread-Topic: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe: Thread-Index: AQHP2MAapayPUkT5UUGj9XqXyFJ3T5wR4sKAgAAPjwCAABZmAIAAZLsAgADPUACAAB2vsIAAAhgAgAAUZmCAAAJtAIAACzAAgAALEACAAB2GAIAAGaqAgALq0gCAAE0RAIAAsPTwgAApkQCAABD+IA== Date: Mon, 29 Sep 2014 10:11:38 +0000 Message-ID: References: <20140926114630.GA3930@hmsreliant.think-freely.org> <20140926134014.GB3930@hmsreliant.think-freely.org> <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> In-Reply-To: <2601191342CEEE43887BDE71AB977258213874C5@IRSMSX104.ger.corp.intel.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" 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: Mon, 29 Sep 2014 10:05:22 -0000 > > > > 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 of > > set/canceled timers. If you suddenly start returning negative values ho= w those > > application will behave? Silently changing returned value domain is evi= l in its > > pure form. >=20 > As I can see the impact is very limited. It is small impact to DPDK but can be huge to user application: Ex: If someone use this kind of expression in callback (skipping user app seria= lization part): callback () { ... some_simple_semaphore +=3D rte_alarm_cancel(...)); ... } Anywhere in the code: ... If (some_simple_semapore) { some_simple_semapore --; if (rte_eal_alarm_set(...) !=3D 0) some_simple_semapore ++; } ... 1. Do you notice the change in cancel function? 2. How many hours you spend to find this issue in case of big app/system? > Only code that does check for (rte_alarm_cancel(...) =3D=3D 0/ !=3D 0) in= side alarm > callback function might be affected. > From other side, indeed, there could exist situations, when the caller ne= eds to > know > was the alarm successfully cancelled or not. > And if not by what reason. >=20 I can extend API of rte alarms to add alarm state checking in next patch, = but for=20 now, since this is not urgent I think original patch v2 should be enough. Pawel