From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 030E1A00BE; Thu, 28 May 2020 16:40:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4246F1DBC6; Thu, 28 May 2020 16:40:23 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BACCE1DBA8 for ; Thu, 28 May 2020 16:40:21 +0200 (CEST) IronPort-SDR: e4tEwzRqd0lQMpzr4hHd+nxop+TbBo+vhiK9K4n5yB8+RUd2RsqKsZC6t4HJzCbdRBVJGSeqat SS5cYX/Cgv6g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 07:40:20 -0700 IronPort-SDR: povY64AaFhnOkZ9sau/Xw6cPvVTAngzO9EOh+DQvfiYytmYlZgOvXII+FDxEE/KN5j/ALSBvyR dIAzhskF1JVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,445,1583222400"; d="scan'208";a="376390493" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.45.206]) ([10.252.45.206]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2020 07:40:18 -0700 To: "Ananyev, Konstantin" , "dev@dpdk.org" Cc: "Richardson, Bruce" , "Hunt, David" , "Ma, Liang J" , "Honnappa.Nagarahalli@arm.com" References: <2772eb151ccba5cc17186e6161d8834176924753.1590598121.git.anatoly.burakov@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 28 May 2020 15:40:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC 1/6] eal: add power management intrinsics 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" On 28-May-20 12:39 PM, Ananyev, Konstantin wrote: > Hi Anatoly, > >> >> Add two new power management intrinsics, and provide an implementation >> in eal/x86 based on UMONITOR/UMWAIT instructions. The instructions >> are implemented as raw byte opcodes because there is not yet widespread >> compiler support for these instructions. >> >> The power management instructions provide an architecture-specific >> function to either wait until a specified TSC timestamp is reached, or >> optionally wait until either a TSC timestamp is reached or a memory >> location is written to. The monitor function also provides an optional >> comparison, to avoid sleeping when the expected write has already >> happened, and no more writes are expected. > > Recently ARM guys introduced new generic API > for similar (as I understand) purposes: rte_wait_until_equal_(16|32|64). > Probably would make sense to unite both APIs into something common > and HW transparent. > Konstantin Hi Konstantin, That's not really similar purpose. This is monitoring a cacheline for writes, not waiting on a specific value. The "expected" value is there as basically a hack to get around the race condition due to the fact that by the time you enter monitoring state, the write you're waiting for may have already happened. -- Thanks, Anatoly