Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2783267ybc; Mon, 25 Nov 2019 04:12:02 -0800 (PST) X-Google-Smtp-Source: APXvYqyr6hOOptARS8Azq7hxF1o/cDQOxYSQ+K+78c9iy2xUY0GiGCDx+EYyXT2OpKFCXWHeR9kg X-Received: by 2002:a50:ec83:: with SMTP id e3mr18105412edr.292.1574683922328; Mon, 25 Nov 2019 04:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574683922; cv=none; d=google.com; s=arc-20160816; b=T5XAY9WXkcmkLEfAoSZ6gFy/V41dnPLjdBLXMTyFeB9tXiKiyCfcQ1elg6k60pq9a+ BgVSxiC1fjnc8e1CQXvV21LgIL+0yIlOa+7F+gVL9kUPkqXvJTnd5G3lgZZyWaw8KERl Z9BO6Z6IZW7rTDmgUyBFdlvBnORHxATiTP601rHwI8SoIW00Swot1Hq/UiCEiNFHeezH wBw4p9pwYTfJDTcQ1kkTnDiLv+3yqUb5Q0kWXVY0494SinAGzL2eg54LoF7tcoogcQTR NzWjQl0UPWltG//D/4pZ2pNpSMWSgiD/NaDudEPwR7pvtg0cT37bmjmh6GkGXGeFAIyG Mrww== 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=gwEMp/XGWHHgJR8Rckc3HD92s709umHW+HR2OxJYKCM=; b=uS73Yvt2DGex+X7xpoPTz5H4nm+OP8XVC8QTwPg8GUNfsvAtvTYUvXzSnwTfD0BHpy Qokh/TyPknfagBviQjjadC2n8Y9Myu6b1FRR2gNNFomCzDJGsBb8/YLUwaBdt3Sk4L2g jyhwAsR5Jhc03Epns90TIX6ltUSDwcVb+K32J2KS2P7gdEKIBEYHPR+fHdURdXCkymA4 +DurqHTWNVGb2HZTd18cJfIWSPM6UZMUjVXbjwb/UOdWmZz8q7UoWx/e8CGtvoQFV2pk fsjTiOgkuemMBQJ1oAaR8n5sIbkoj7wigB1EexEJ/zkCbuj3+yyh0y9+YvkFMIGxhrn6 3oGQ== 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 l2si4365049ejx.420.2019.11.25.04.11.37; Mon, 25 Nov 2019 04:12:02 -0800 (PST) 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 S1727393AbfKYJqf (ORCPT + 99 others); Mon, 25 Nov 2019 04:46:35 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59238 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727133AbfKYJqe (ORCPT ); Mon, 25 Nov 2019 04:46:34 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAP9gFkR005525 for ; Mon, 25 Nov 2019 04:46:33 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wfk3nbhf9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Nov 2019 04:46:32 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Nov 2019 09:46:30 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 25 Nov 2019 09:46:26 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAP9kPgO43385022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2019 09:46:25 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2007BA405B; Mon, 25 Nov 2019 09:46:25 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 501AFA4054; Mon, 25 Nov 2019 09:46:22 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.38]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 25 Nov 2019 09:46:22 +0000 (GMT) From: Parth Shah To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, patrick.bellasi@matbug.net, valentin.schneider@arm.com, qais.yousef@arm.com, pavel@ucw.cz, dhaval.giani@oracle.com, qperret@qperret.net, David.Laight@ACULAB.COM, morten.rasmussen@arm.com, pjt@google.com, tj@kernel.org, dietmar.eggemann@arm.com, viresh.kumar@linaro.org, rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org Subject: [RFC 1/3] Introduce latency-tolerance as an per-task attribute Date: Mon, 25 Nov 2019 15:16:16 +0530 X-Mailer: git-send-email 2.17.2 In-Reply-To: <20191125094618.30298-1-parth@linux.ibm.com> References: <20191125094618.30298-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19112509-0020-0000-0000-0000038E7444 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112509-0021-0000-0000-000021E4BD1F Message-Id: <20191125094618.30298-2-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-25_02:2019-11-21,2019-11-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 priorityscore=1501 mlxlogscore=782 malwarescore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 impostorscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911250089 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Latency-tolerance indicates the latency requirements of a task with respect to the other tasks in the system. The value of the attribute can be within the range of [-20, 19] both inclusive to be in-line with the values just like task nice values. latency_tolerance = -20 indicates the task to have the least latency as compared to the tasks having latency_tolerance = +19. The latency_tolerance may affect only the CFS SCHED_CLASS by getting latency requirements from the userspace. Signed-off-by: Parth Shah --- include/linux/sched.h | 3 +++ include/linux/sched/latency_tolerance.h | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 include/linux/sched/latency_tolerance.h diff --git a/include/linux/sched.h b/include/linux/sched.h index 2c2e56bd8913..bcc1c1d0856d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -666,6 +667,8 @@ struct task_struct { #endif int on_rq; + int latency_tolerance; + int prio; int static_prio; int normal_prio; diff --git a/include/linux/sched/latency_tolerance.h b/include/linux/sched/latency_tolerance.h new file mode 100644 index 000000000000..7a00abe05bc4 --- /dev/null +++ b/include/linux/sched/latency_tolerance.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_SCHED_LATENCY_TOLERANCE_H +#define _LINUX_SCHED_LATENCY_TOLERANCE_H + +#define MAX_LATENCY_TOLERANCE 19 +#define MIN_LATENCY_TOLERANCE -20 + +#define LATENCY_TOLERANCE_WIDTH \ + (MAX_LATENCY_TOLERANCE - MIN_LATENCY_TOLERANCE + 1) + +#define DEFAULT_LATENCY_TOLERANCE 0 + +#endif /* _LINUX_SCHED_LATENCY_TOLERANCE_H */ -- 2.17.2