From: Gautham R Shenoy Date: Tue, 31 Mar 2020 12:26:47 +0000 Subject: Re: [RFC/PATCH 0/3] Add support for stop instruction inside KVM guest Message-Id: <20200331121447.GA1996@in.ibm.com> List-Id: References: <1585656658-1838-1-git-send-email-ego@linux.vnet.ibm.com> In-Reply-To: <1585656658-1838-1-git-send-email-ego@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Gautham R. Shenoy" Cc: Michael Neuling , Nicholas Piggin , Bharata B Rao , linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org, Vaidyanathan Srinivasan , linuxppc-dev@lists.ozlabs.org, David Gibson On Tue, Mar 31, 2020 at 05:40:55PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > > *** RFC Only. Not intended for inclusion ************ > > Motivation > ~~~~~~~~~~~~~~~ > > The POWER ISA v3.0 allows stop instruction to be executed from a Guest > Kernel (HV=0,PR=0) context. If the hypervisor has cleared > PSSCR[ESL|EC] bits, then the stop instruction thus executed will cause > the vCPU thread to "pause", thereby donating its cycles to the other > threads in the core until the paused thread is woken up by an > interrupt. If the hypervisor has set the PSSCR[ESL|EC] bits, then > execution of the "stop" instruction will raise a Hypervisor Facility > Unavailable exception. > > The stop idle state in the guest (henceforth referred to as stop0lite) > when enabled > > * has a very small wakeup latency (1-3us) comparable to that of > snooze and considerably better compared the Shared CEDE state > (25-30us). Results are provided below for wakeup latency measured > by waking up an idle CPU in a given state using a timer as well as > using an IPI. > > =================================== > Wakeup Latency measured using a timer (in ns) [Lower is better] > =================================== > Idle state | Nr samples | Min | Max | Median | Avg | Stddev| > =================================== > snooze | 60 | 787 | 1059 | 938 | 937.4 | 42.27 | > =================================== > stop0lite | 60 | 770 | 1182 | 948 | 946.4 | 67.41 | > =================================== > Shared CEDE| 60 | 9550 | 36694 | 29219 |28564.1|3545.9 | > =================================== > Posted two copies of Wakeup latency measured by timer. Here is the wakeup latency measured using an IPI. =================================== Wakeup latency measured using an IPI (in ns) [Lower is better] =================================== Idle state | Nr | Min | Max | Median | Avg | Stddev | |samples | | | | | | ---------------------------------------------------------------------- snooze | 60 | 2089| 4228| 2259| 2342.31| 316.56| ---------------------------------------------------------------------- stop0lite | 60 | 1947| 3674| 2653| 2610.57| 266.73| ---------------------------------------------------------------------- Shared CEDE| 60 | 20147| 36305| 21827| 26762.65| 6875.01| =================================== -- Thanks and Regards gautham.