Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2653501ybc; Mon, 25 Nov 2019 01:50:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxW3f7DA2OetcG3wkv6/p6HAcy/jlQ4URCA4Cj6ha4y9ZJk7ku6Xry/pgjwCg1KyydR6lWr X-Received: by 2002:a50:9a85:: with SMTP id p5mr17327648edb.223.1574675428944; Mon, 25 Nov 2019 01:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574675428; cv=none; d=google.com; s=arc-20160816; b=gtagE5t4MG7buyRzxhQsdB673sCABuMsUvmucliEYHnmc0E/BiMS70KjlYqWJ7xS3p H8LbNOHZhSVAk4m4+kaQv02UFQZebh4TY0IkF791D9+zNRhPYPq1dcej4gqzEeUEiTN5 AtmGj2XdnygZK5/OPiYzjEJJavNg5skyitWr4zZtLjxe0a3yi8/6jUfBg22ooCiGMkSB /PWgbv3PSLKtCIZpsXzZJZCAGzNPpfDTVmGVEi+3mcxcdRldVH9qEnUOoSuzsvE7Jjrx Pfe143Bmp3O+MPVWMMG2BfTqQf656S7r7oyZuJgSYW+f14Psie0SYbDpmNTykXlmPa01 NUtQ== 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=mSu0pQnreh3eEtilQM1XGljh65ihovWeMuiit5Fs88M=; b=ZaDztIi6h0wXsZNO4Y8sOZk50bfedMYnLmzEFdx39yBi1GcO3RDYd6pCxjCmP0vh1D flj52fyUwXbmgaUuO8uCUwDzPSwJdOUe8Sv2zNCRVkQNeVHyf5+3OGF/TTBoPUZ0V6OK NDQSF39zqQlpPrWV2AyBxzHqqA9SE0Cj3IOMmJmSXTcILupMPFnXMnSChL8SyTdLW7fF c4OvdP/HwjHHf8tSWX1lvam01rBpDyxCTGDTMW1euKmvDRTitltkKYvOVgOzz6n+l9A1 /YyJIeQPtOrJwAZ55iEDjC3qW6rvqmRsQNk/BLeuVt8AmOZ8E5fxD/Mdnh3orCdsOHV9 LoNw== 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 w24si4411823edu.376.2019.11.25.01.50.05; Mon, 25 Nov 2019 01:50:28 -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 S1727418AbfKYJrO (ORCPT + 99 others); Mon, 25 Nov 2019 04:47:14 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:21898 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727133AbfKYJrO (ORCPT ); Mon, 25 Nov 2019 04:47:14 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAP9lDxl086555 for ; Mon, 25 Nov 2019 04:47:13 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wfjqxv424-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Nov 2019 04:47:12 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Nov 2019 09:46:34 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) 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:29 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAP9kS2G55050384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Nov 2019 09:46:28 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 42DF6A4064; Mon, 25 Nov 2019 09:46:28 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6DA9EA405C; Mon, 25 Nov 2019 09:46:25 +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:25 +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 2/3] Propagate parent task's latency requirements to the child task Date: Mon, 25 Nov 2019 15:16:17 +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-0016-0000-0000-000002CBECD7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19112509-0017-0000-0000-0000332DBF73 Message-Id: <20191125094618.30298-3-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 malwarescore=0 suspectscore=1 bulkscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 mlxlogscore=726 spamscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911250090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clone parent task's latency_tolerance attribute to the forked child task. Reset the latency_tolerance value to default value when the child task is set to sched_reset_on_fork. Signed-off-by: Parth Shah --- kernel/sched/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7880f4f64d0e..ea7abbf5c1bb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2853,6 +2853,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) */ p->prio = current->normal_prio; + /* Propagate the parent's latency requirements to the child as well */ + p->latency_tolerance = current->latency_tolerance; + uclamp_fork(p); /* @@ -2869,6 +2872,7 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->prio = p->normal_prio = __normal_prio(p); set_load_weight(p, false); + p->latency_tolerance = DEFAULT_LATENCY_TOLERANCE; /* * We don't need the reset flag anymore after the fork. It has * fulfilled its duty: -- 2.17.2