Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3202545ybd; Mon, 24 Jun 2019 21:39:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjkpCml4xbHkV6w5G4uT6TFal+YfwDjHmQJUuoNbnBxwNgwexz4l1Cbs9EOsLEglesJKJD X-Received: by 2002:a65:40cb:: with SMTP id u11mr38560562pgp.333.1561437550517; Mon, 24 Jun 2019 21:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561437550; cv=none; d=google.com; s=arc-20160816; b=zVLKpq2RuvIR6CSQ/8JaeZCsM3jitxkQrYUPR4egwJF674l1+nJD4vv0/Y+P/2Pase 2SbH0j2kpt3C8xjH2bNGe2F8IxPugOvallgugT0CsM4aXbcNL8qOTf9t+Ng4ZXwFhDrL Q1rXQT0KacWnYzPEDAypHc0UptyUmCWg3CzEypTBjc3XeYDitOa3JOQ54MY0zEDNFZeA 2Pwi4kFwi+x8soe5GsJNNwQR6rN2p2KzaZKoJ9x3ZqhmaufOMrSTQYCrsxX2ff/YMp4v QcMPbTwXwJtLIaZsbRosIJFqTJJn4MVv8kikVI9P3Sm1qjekOLRXFA+6egMj3Ph1nRqE a/cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=Rb9C+LSmPeaus2urJF1MRAkEUoKwqwDvfeZl8HxpfjA=; b=KHRX/aVsX8rRXbtk7Z5i3ZsvXbIvuLZEL7/aruUAssm5/hbf1LxtiMjIHoPyT+UYlW EvQ7fEnRYjqPKPrslQ8Gh17NBiJzcNIGZ/4y3jBC4N6PkMDYL1S2hfw8MDHgtqinT7aG DFJpKGxHwOg4qoL80Yc0LzjlmvJ4krXDmD3pmRGCtGjBFD/PXG9cVBE8sNJ6PNA2URgZ cnl8xXjiypq0yIBJETC4c2firhq7iYkQSm8nuJbsTyhwLLaL9YXNbnwKJMTc8+U9Z6B1 wrx3ZciEu3dx6GTfYQF4ws/D+6BNqWqnLfuxtjbld6+r/QAh9AUocOe32sGmoje34ru2 wP4A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si1640071pju.32.2019.06.24.21.38.55; Mon, 24 Jun 2019 21:39:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726964AbfFYEhn (ORCPT + 99 others); Tue, 25 Jun 2019 00:37:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28096 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbfFYEhl (ORCPT ); Tue, 25 Jun 2019 00:37:41 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5P4XBGA059032 for ; Tue, 25 Jun 2019 00:37:40 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tb9q4wx3e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Jun 2019 00:37:40 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Jun 2019 05:37:38 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 25 Jun 2019 05:37:34 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5P4bXr139780544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2019 04:37:33 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5312E11C050; Tue, 25 Jun 2019 04:37:33 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17BDE11C052; Tue, 25 Jun 2019 04:37:32 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.87]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 25 Jun 2019 04:37:31 +0000 (GMT) From: Parth Shah To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, dietmar.eggemann@arm.com, patrick.bellasi@arm.com Subject: [RFCv3 3/8] sched/core: Update turbo_sched count only when required Date: Tue, 25 Jun 2019 10:07:21 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625043726.21490-1-parth@linux.ibm.com> References: <20190625043726.21490-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19062504-0012-0000-0000-0000032C1B4F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062504-0013-0000-0000-000021654EDE Message-Id: <20190625043726.21490-4-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-25_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906250036 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the get/put methods to add/remove the use of TurboSched support, such that the feature is turned on only if there is atleast one jitter task. Signed-off-by: Parth Shah --- kernel/sched/core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ef83725bd4b0..c7b628d0be2b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1214,10 +1214,13 @@ static void __setscheduler_uclamp(struct task_struct *p, * Set task to jitter class if Max util is clamped to the least * possible value */ - if (p->uclamp_req[UCLAMP_MAX].bucket_id == 0 && !p->is_jitter) + if (p->uclamp_req[UCLAMP_MAX].bucket_id == 0 && !p->is_jitter) { p->is_jitter = 1; - else if (p->is_jitter) + turbo_sched_get(); + } else if (p->is_jitter) { p->is_jitter = 0; + turbo_sched_put(); + } } } @@ -3215,6 +3218,9 @@ static struct rq *finish_task_switch(struct task_struct *prev) mmdrop(mm); } if (unlikely(prev_state == TASK_DEAD)) { + if (unlikely(prev->is_jitter)) + turbo_sched_put(); + if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); -- 2.17.1