Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3094983pxy; Sun, 25 Apr 2021 13:51:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg7HIgEihY+Dwk7B8d09gNHgsmqPDX8S5FdiVFPHJnjF64u0Qu/93DlLmIfoC+4ScFaouQ X-Received: by 2002:a17:906:2546:: with SMTP id j6mr15058884ejb.51.1619383862016; Sun, 25 Apr 2021 13:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619383862; cv=none; d=google.com; s=arc-20160816; b=Q8axJBpMyBjIImcQCqDJ5w1BgQuOnVAe4oTWqC1fw0GqVQsdNPCT5DZsjiWxSfB81t KlH7HjYPIhGgr8xNe0S7qE766YXTlKAjZl/PX99bMUnF54jtV0orErxKWlUMfsQWeriJ IFbCk4ycsZIZEoqZ5j/haJpuunGHj2kfHrcwqJNFBadH3ZjKF6K1x8nuRNuDxytZbkAF ctK+IvtNjtx7oM20JmOy1zC+6VAp6t5ul7ItDln0TCaRXn5bcUo0RiAO25XHxgLsywfB CFHC0vq5wENLe8x44acd6fYy5kpBDfpw1CsqtrsT/+ytyBvw2RB3WZ6jnMWpLrEpnBzE JEOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+CjY/BeYZawNKicl6vyRrVfgxDrQti0ByfrXh5ynJ1g=; b=MwEdtc7I4734E1Qrln8zjtd15901+Vlhx/CsR26np1/4KpnlffD3b9mopkf4E+MTi4 7cdGgLel7jolvxYRUnhCshHz6GOOTiIxBCgaejx9IwO6d+ykMyJYYBUY6uSvFHcHSv53 zqV/VmU/0nSP4MqEvsxDAb3WXcFrIWdfARSyi/dnFtFjdHINuXF9GMl2Ed/8dslStlFf zhcVbZfQWBifFJQR5l5C1S0Fv3L6nPejxOaxN21gI5SUisd2kvUhVI59/bJeSyI3n49B LgK0OriLMCl6WREP6M5xzKyrChC+8BEkbPfLWO36iu8/zokzEXaYJ4w0UbKiZbMKQU2y Kt9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=MvHkrpsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi21si11703670edb.439.2021.04.25.13.50.38; Sun, 25 Apr 2021 13:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=MvHkrpsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbhDYUuY (ORCPT + 99 others); Sun, 25 Apr 2021 16:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhDYUuY (ORCPT ); Sun, 25 Apr 2021 16:50:24 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA147C061574 for ; Sun, 25 Apr 2021 13:49:43 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id s16so48721979iog.9 for ; Sun, 25 Apr 2021 13:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+CjY/BeYZawNKicl6vyRrVfgxDrQti0ByfrXh5ynJ1g=; b=MvHkrpsDc/s8YcsoK6tEhN6hZUOs3e5cS9Ay4ONM+vtFVImNeXWEEbnIboOGkBMJb4 zMinlSNBi3IgMNBKxWZJYFvqpbnYJzvxuUbLugUai1K+V95rBi6R7MNX16rno/dCysRa C1xYUnOnj8d6MOo0MKoUMxEiBOctbSBBpLI5hBvexYn20CaeTjqvO7n97C4tdOOLz2o/ TbvRm7/XUFDZ28zbNEmQVjtyP+dmUHqPfJN2QQc/NRZacllC/ZQ7qzx7yGT8WM0whsh7 mGWJp8EETCsQRHIOvyZdw1OyfwmcEIKgX/ukngyud8qSFxI1ZH2LOu+l9JS8jLVJJXnW CXGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+CjY/BeYZawNKicl6vyRrVfgxDrQti0ByfrXh5ynJ1g=; b=TQ8XRjq+9DPwyVr5oNXmBwy6AsxUUAp/h2x2zD2GY/Fq6iTqHqKw0VycKcoHCipVki 8DiR2LHtnspT677vwFBWdiIoIdFQOs8rQoyqLO0tPrmKbEYMdsJe3eF3wMi9aM12Jrj8 Pn+Y8X+qfcT4HbjgQ931tmHOejAgItlyaizHAoTj9l8yxzstcYIkYVSB8DNjRuBlJnMZ ii2L/79c2G6UUlx0S7SCojzOCstPq1QuV/LH/BhQLOS9Es3oSRaIZkCiMFmFS/hoYY5B zo15LhMFPo03xydX9HXMmdbDAQtHRmAb/jnb/ZXZ93Nsb7tDGOZKHnm1uITFGUlBP7M3 g16g== X-Gm-Message-State: AOAM530JrkRD4aGguwCgU5RQnzk+9KwGjq8L7qe1ldoqlj87c2RSfNKI OByEVGeyR0MhMSCt0BRKCIwg6jgSwi6Tqao1/IHAmg== X-Received: by 2002:a5d:9cd8:: with SMTP id w24mr11597320iow.78.1619383783189; Sun, 25 Apr 2021 13:49:43 -0700 (PDT) MIME-Version: 1.0 References: <20210412074309.38484-1-psampat@linux.ibm.com> <20210412074309.38484-3-psampat@linux.ibm.com> In-Reply-To: <20210412074309.38484-3-psampat@linux.ibm.com> From: Doug Smythies Date: Sun, 25 Apr 2021 13:49:32 -0700 Message-ID: Subject: Re: [RFC v4 2/2] selftest/cpuidle: Add support for cpuidle latency measurement To: Pratik Rajesh Sampat Cc: rjw@rjwysocki.net, Daniel Lezcano , shuah@kernel.org, ego@linux.vnet.ibm.com, svaidy@linux.ibm.com, Linux PM list , Linux Kernel Mailing List , linux-kselftest@vger.kernel.org, pratik.r.sampat@gmail.com, dsmythies Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pratik, On Mon, Apr 12, 2021 at 12:43 AM Pratik Rajesh Sampat wrote: > > The cpuidle latency selftest provides support to systematically extract, > analyse and present IPI and timer based wakeup latencies for each CPU > and each idle state available on the system. > > The selftest leverages test-cpuidle_latency module's debugfs interface > to interact and extract latency information from the kernel. > > The selftest inserts the module if already not inserted, disables all > the idle states and enables them one by one testing the following: > 1. Keeping source CPU constant, iterate through all the CPUS measuring > IPI latency for baseline (CPU is busy with cat /dev/random > /dev/null > workload) and then when the CPU is allowed to be at rest > 2. Iterating through all the CPUs, sending expected timer durations to > be equivalent to the residency of the deepest idle state enabled > and extracting the difference in time between the time of wakeup and > the expected timer duration > > The timer based test produces run to run variance on some intel based > systems that sport a mechansim "C-state pre-wake" which can > pre-wake a CPU from an idle state when timers are armed. For systems and > architectures that don't have this mechansim can leverage timer tests > with the -i option. > > To run this test specifically: > $ sudo make -C tools/testing/selftests TARGETS="cpuidle" run_tests > > There are a few optional arguments too that the script can take > [-h ] > [-i ] > [-m ] > [-o ] > [-v (run on all cpus)] > Default Output location in: tools/testing/selftest/cpuidle/cpuidle.log > > To run the test without re-compiling: > $ cd tools/testing/selftest/cpuidle/ > $ sudo ./cpuidle.sh > > Signed-off-by: Pratik Rajesh Sampat Reviewed-by: Doug Smythies ...