From patchwork Wed Sep 20 04:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 113080 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp315380qgf; Tue, 19 Sep 2017 21:47:30 -0700 (PDT) X-Received: by 10.98.15.13 with SMTP id x13mr882195pfi.249.1505882850753; Tue, 19 Sep 2017 21:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505882850; cv=none; d=google.com; s=arc-20160816; b=WnAHZiTMiLcZtjS4MsAgiHUO4TdXtolGYFhIiSREoyaikNWrFjWwJaD9lz1hQ+Nm75 WR/h3mTbbDU4DlxiSXHGR0AYnSOrvIBT+Ch6w3J57612WD9YF3Hl/CsWdlhIv0rkf53G /W3Zp/9/MLrtpkrnBzSZoFWrYXeFfgT6eIxcr8092usTi4pNYZOPGLmHIZSNArbX5pvI 48m7b72ZdUO78PDGJtG9DomL0fyWBVwAojvkKgfqfC8uJ4VZjv3wIpsvzDX7WcGh1ZfA ClL3T6SNbKN8lsCYW/ZnGPBBb6oKVSbRf4KPBydHZrySnCdOK30StrU59MRgwobTSfCX ULcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=7l1nlaJUvLAvmE9tf09ieA1b26GIrhW9ERxcn2CvvNo=; b=ONTwq7DzKbtlSzm7JOzYtdNOv7Bl/BL3DZNpuqHghCpK3CDllE0jx6Z/uKYdTz95YN k+WKV2qYK+Sm1Ax8xsNVYMHUwyXZjXHQ7yGn0u43McXVzpl4EasK66vZbu2Ojn3ivO1G TO9BsmaRTcXBUs5slXBTNlYaN8BCkeRoin+hePGssi1NNzFnAPFLzlAYWCVE74lOUpj7 DPiISl0CSDczFYl/OEJpUlaHHFr1NrdO9d/DAp5+XyiTTmu4oD2+4X66Q9B29eF6ONDD JKSYa5qHZ/NOpA1C2FnCwlnWtzUDPBGK8S6+xKHjOVJVL6qBj6w/cnIT7JoLn10BvCxs zQ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R9ppmXEo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si1228102pgc.320.2017.09.19.21.47.30; Tue, 19 Sep 2017 21:47:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R9ppmXEo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbdITEr2 (ORCPT + 26 others); Wed, 20 Sep 2017 00:47:28 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:46793 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdITErN (ORCPT ); Wed, 20 Sep 2017 00:47:13 -0400 Received: by mail-pf0-f182.google.com with SMTP id r68so974545pfj.3 for ; Tue, 19 Sep 2017 21:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7l1nlaJUvLAvmE9tf09ieA1b26GIrhW9ERxcn2CvvNo=; b=R9ppmXEoHit6UZYGPyhmk2OTPpi2YKOL3W6ukMtEV0nU/fJuqOsPw2LBBC2MOmSTbT BEbH6TjVuIOqWGvOa8TxtwYwx9mFjoGUCUvxuBM5cc44vl2rC4ob8oz4c1Qluh6l+PFl +eeZMeJUaEW1VJZlXDBc48EQ53quIDEjL/Q80= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7l1nlaJUvLAvmE9tf09ieA1b26GIrhW9ERxcn2CvvNo=; b=cENOLbZv6fq/VCTPOwpOuVjaFgv0n8tr3KinzY1MjJMrAD8jOZzWuvGzVxS8BkVN5P Oj83mMZaRvsmUEcRglaF47NU4YdwJPxXzD1frxQesJdVEfnJVGnACyqmrqrxOW8+nJ4I bzjZX8g1BQgFnJlW9FK0V3ILeNJO0hKSi9gOzKV2h9QX/zdHAzzbq8GhxJ+GRGETZLVP kS/pKqhzDZVcX1KO2Crbe8unJsqyj5IqcIS7u6lDHGrUBIUt4+AnyohKexN/RiT1KOlD V3itbQv5Ox7JLYcHeEGRu3l9wue+MHXKhGzb4kIIZzSECjnlfhuPVqwLvkT8KEJGKket gAFA== X-Gm-Message-State: AHPjjUg2lQxdHcehCup1O8e/ZQpVzsDo73a6ceDvaUktpYu+ZgUezb21 UjRn46iHeWOMWdOXkyCQDK5xvQ== X-Google-Smtp-Source: AOwi7QB6lENvvNGX3E9l96WN6OgUX96mDNgCAUlflVrHmh3MopsgnTiRrjEu1TrBQtk1+YoqJdLHLA== X-Received: by 10.101.93.5 with SMTP id e5mr901549pgr.55.1505882833052; Tue, 19 Sep 2017 21:47:13 -0700 (PDT) Received: from localhost.localdomain (c-69-181-16-182.hsd1.ca.comcast.net. [69.181.16.182]) by smtp.gmail.com with ESMTPSA id m21sm6398665pgn.60.2017.09.19.21.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 21:47:11 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , Jonathan Corbet , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Kim Phillips Cc: Leo Yan , Sudeep Holla Subject: [PATCH v3] doc: coresight: correct usage for disabling idle states Date: Wed, 20 Sep 2017 12:46:57 +0800 Message-Id: <1505882817-19582-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the coresight CPU debug document it suggests to use 'echo' command to set latency request to /dev/cpu_dma_latency so can disable all CPU idle states, but in fact this doesn't work. This is because when the command 'echo' exits, it releases the device node's file descriptor and the kernel release function removes the QoS constraint; finally when the command 'echo' finished there have no constraint imposed on cpu_dma_latency. This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the command 'exec' can avoid the file descriptor to be closed so we can keep the constraint on cpu_dma_latency. This patch also adds the info for reference docs for PM QoS and cpuidle sysfs. Cc: Jonathan Corbet Cc: Sudeep Holla Reported-by: Kim Phillips Suggested-by: Mathieu Poirier Signed-off-by: Leo Yan --- Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt index b3da1f9..2b9b51c 100644 --- a/Documentation/trace/coresight-cpu-debug.txt +++ b/Documentation/trace/coresight-cpu-debug.txt @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or At the runtime you can disable idle states with below methods: -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle -states (if latency = 0uS then disable all idle states): -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency - -Disable specific CPU's specific idle state: +It is possible to disable CPU idle states by way of the PM QoS +subsystem, more specifically by using the "/dev/cpu_dma_latency" +interface (see Documentation/power/pm_qos_interface.txt for more +details). As specified in the PM QoS documentation the requested +parameter will stay in effect until the file descriptor is released. +For example: + +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3 +... +Do some work... +... +# exec 3<>- + +The same can also be done from an application program. + +Disable specific CPU's specific idle state from cpuidle sysfs (see +Documentation/cpuidle/sysfs.txt): # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable