From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 202C51B5CE for ; Wed, 19 Dec 2018 17:11:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2018 08:11:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,373,1539673200"; d="scan'208";a="285033807" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 19 Dec 2018 08:11:58 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 08:11:58 -0800 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.22]) by FMSMSX114.amr.corp.intel.com ([169.254.6.66]) with mapi id 14.03.0415.000; Wed, 19 Dec 2018 08:11:58 -0800 From: "Carrillo, Erik G" To: "Gavin Hu (Arm Technology China)" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/1] timer: fix race condition Thread-Index: AQHUiBTifbW0/h5kgU2Fio0KuJfJPKWGDhyAgABIsYD///9TQA== Date: Wed, 19 Dec 2018 16:11:57 +0000 Message-ID: References: <1543517626-142526-1-git-send-email-erik.g.carrillo@intel.com> <3302607.WHYlCW4uPu@xps> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTFjNzMzMWEtOWQ3Zi00YjA0LWEwMTQtODBhMmVkOWU5ZjcxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicWVqelYrVlwvK0l0XC8zcVFBUjlhc1JYdFJUbkZNV2V2TUZFS2xUXC9PQ05sVmhNa09Wbm1pbWptaTNuZ3pHV2J3TyJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/1] timer: fix race condition 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: Wed, 19 Dec 2018 16:12:00 -0000 > > > However, if a timer expires quickly enough, there exists the > > > following race condition that causes the timer_manage() routine to > > > misinterpret a timer in CONFIG state, resulting in lost timers: > > > > > > - Thread A: > > > - starts a timer with rte_timer_reset() > > > - the timer is moved to CONFIG state > > > - the spinlock associated with the appropriate skiplist is acquired > > > - timer is inserted into the skiplist > > > - the spinlock is released > > > - Thread B: > > > - executes rte_timer_manage() > > > - find above timer as expired, add it to run list > > > - walk run list, see above timer still in CONFIG state, unlink it f= rom > > > run list and continue on > > > - Thread A: > > > - move timer to PENDING state > > > - return from rte_timer_reset() > > > - timer is now in PENDING state, but not actually linked into > > > skiplist > Add "nor the run list"? <...snipped...> > Other than the minor comment, > Reviewed-by: Gavin Hu >=20 <...snipped...> Thanks for the review, Gavin. I've made the update and resubmitted. Regards, Erik