Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp743414ybj; Thu, 7 May 2020 06:42:58 -0700 (PDT) X-Google-Smtp-Source: APiQypJMMUUFlV9qSxqxQeVNiKq05RQchkywE4Aa0/6SDMae8I1yjpd5MuEslcR2DimZye3JSVxh X-Received: by 2002:a50:a985:: with SMTP id n5mr11795530edc.338.1588858978535; Thu, 07 May 2020 06:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588858978; cv=none; d=google.com; s=arc-20160816; b=svy2mKFgzL6aJXzpbQSJGf/NX0b65PyboA3OPVMe0Peld7OPZS9j99f/zJD07d4iL1 i3HpMXSmfDrBG1BXwEiIHqHhdLwsuHxzOhzpch88xsancp+nHBCvozb93lu3epyXDT81 Mz/GR4cyQle8uOPMFPiZkOCZtUua9J+mWcVjeyMW1AfxYpxbH9zUBCDcbMtVFfq6z1hA n9EeYjI7h1VH/bwXBFcGRcjSBPsbGkYLqLKtnTa9/30YbJBop3xx4GnYMZlYrbMxvIRp zEtMtod0vItYG6MG8alqkrZIeZE2tYUyiTHbHl1caSQE5MChOQ9oQEzMJfOCqmYUn6MB vLTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=UbZzwsxyHCQ27NhZJCBSYwpsOD18gCoGLpBx804Slcc=; b=nVC6DDvzjx+X/1xz5dutVz7xulVXpnK7Mj61vZdpzFTxDS7KeNntpd7GAp5POqcQ1Z 7o38gNyLju8eZBR2cvpSbIdUs+yY8Sc7NxAqNsvcH7xUecS75+KPHlAGOWqPpuFA40ek QPHtAf+qAvkOnv1z3HSgZd5+Sx9BA5MIncmQAumbkzvfYPptAt7GtRPtztjhPfbjbKN2 SML29sNWT/oHI2gIOO1Ep4DVyV/B2u48JMuJEJxjJtz3+RTkCoN/j755z95Sjh4jJvhM 3bqTmHHddPiWKBgYQP7mlfcq66zu+4oje7/VEk7AJjgPN6ocuNcGzQj1K1CHeIhdmCaM 80OQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si3221120edj.12.2020.05.07.06.42.29; Thu, 07 May 2020 06:42:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbgEGNiO (ORCPT + 99 others); Thu, 7 May 2020 09:38:14 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45336 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgEGNiO (ORCPT ); Thu, 7 May 2020 09:38:14 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 047DVjIc065847; Thu, 7 May 2020 09:38:04 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30s4gx427u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 09:38:03 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 047DViBU065499; Thu, 7 May 2020 09:38:02 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 30s4gx41yp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 09:38:02 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 047DUZsb002128; Thu, 7 May 2020 13:37:49 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma05fra.de.ibm.com with ESMTP id 30s0g5mmrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 13:37:48 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 047DbkBj14942354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 May 2020 13:37:46 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7423AE057; Thu, 7 May 2020 13:37:46 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9280AE053; Thu, 7 May 2020 13:37:42 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.85.97.135]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 May 2020 13:37:42 +0000 (GMT) From: Parth Shah To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, qais.yousef@arm.com, chris.hyser@oracle.com, pkondeti@codeaurora.org, valentin.schneider@arm.com, rjw@rjwysocki.net Subject: [RFC 4/4] sched/idle: Add debugging bits to validate inconsistency in latency sensitive task calculations Date: Thu, 7 May 2020 19:07:23 +0530 Message-Id: <20200507133723.18325-5-parth@linux.ibm.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200507133723.18325-1-parth@linux.ibm.com> References: <20200507133723.18325-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-07_08:2020-05-07,2020-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 mlxlogscore=906 clxscore=1015 bulkscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 impostorscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005070106 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We monitor the task entering/exiting the scheduler, but there might be unhandled situations which can lead to inconsistent value of the nr_lat_sensitive counter. This may lead to restricting the use of IDLE states despite absence of any latency sensitive workload. Hence, add pr_info() if a negative value of nr_lat_sensitive value is found. Signed-off-by: Parth Shah --- kernel/sched/idle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 85d72a6e2521..7aa0775e69c0 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -231,6 +231,11 @@ static void cpuidle_idle_call(void) static void do_idle(void) { int cpu = smp_processor_id(); + int pm_disabled = per_cpu(nr_lat_sensitive, cpu); + + if (pm_disabled < 0) + pr_info("Inconsistent value of nr_lat_sensitive counter\n"); + /* * If the arch has a polling bit, we maintain an invariant: * @@ -263,7 +268,7 @@ static void do_idle(void) * idle as we know that the IPI is going to arrive right away. */ if (cpu_idle_force_poll || tick_check_broadcast_expired() || - per_cpu(nr_lat_sensitive, cpu)) { + pm_disabled) { tick_nohz_idle_restart_tick(); cpu_idle_poll(); } else { -- 2.17.2