Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2688336ybl; Sat, 7 Dec 2019 22:05:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyrICZotaPyt9VeurDQZjzJV3su2zuAV4JGVGfCwHC0AcE6Ye8VwaRwVE0i18RCH9Z98eRG X-Received: by 2002:aca:48d6:: with SMTP id v205mr18857038oia.10.1575785114656; Sat, 07 Dec 2019 22:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575785114; cv=none; d=google.com; s=arc-20160816; b=j5AszMXoRNJJOaJ3KuAWrr40Y9GplM8l8tLdcq2MAIZS5iSmbwT7g45jinW33eNcxj cYtvGpnZSHPCY71ASie39LHSIhibDwid3Rv33Nqr71dOqZXwonbLJdybyyl6DA9Ft5IT hYhmIJp5oiwn8sSwQKSrH/DkQoSbz6X1UCAX9lktpeSqYqSPglkxsS+1w2WUj7SEihVT uzW2OKHP2TDVht3oLcUTUd6KOkl1jYFbtan0RZfGkM0ZO4A/Ys4mnYtfkuVXjm+L37w8 ovbn70RZgw+iwDX5l2xyGyT/8Y2SwTKUkMwqecLb8JQcsm93i3yjcHRXjoonmTZA4qWg 2CMw== 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=12RjsxT+f//7+MGNxmjrALPG22cDEY0WgZmEPB7HdWY=; b=aiz2vNirx+VTrJPIAB8jDNT0nuZ4q4wh1MbFhuCskAIf+c31mmzUyhubMdexG7SFZR domq1oKttLDXCqUUPNNKZIZUb8vQoJnDOJhRKk2OKrTye4cn5HiuafzyP6Yy8QqTLfd3 d5QSxhRXKM70cLCIvOhzRllHdjJKgv4p2XFZOQ65VjpovV9fXbG1K5rh6o45FDrnoZIZ oITb8Y4BMCf3iGStS8U9y6IVpoLpmtEnpb9AHMwcqEtQm9PVNQ7NaF4hGhTbQ1vdVu4X DP662q04yN6ko+2JA4IWIIkrYT913SV0aH5mEfmAyz/9IWSb78ADFl3ol+txm45Zauc4 z2bA== 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 d24si9866561otp.110.2019.12.07.22.05.01; Sat, 07 Dec 2019 22:05:14 -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 S1726505AbfLHGEf (ORCPT + 99 others); Sun, 8 Dec 2019 01:04:35 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:7882 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbfLHGEe (ORCPT ); Sun, 8 Dec 2019 01:04:34 -0500 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 xB85xFug052229 for ; Sun, 8 Dec 2019 01:04:33 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wr8kuybfh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 08 Dec 2019 01:04:33 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 8 Dec 2019 06:04:31 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 8 Dec 2019 06:04:27 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB864Qim33292494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 8 Dec 2019 06:04:26 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4E61A11C04C; Sun, 8 Dec 2019 06:04:26 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E0DE11C04A; Sun, 8 Dec 2019 06:04:22 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.71.101]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 8 Dec 2019 06:04:21 +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, pjt@google.com, tj@kernel.org, dietmar.eggemann@arm.com Subject: [PATCH v2 2/3] sched/core: Propagate parent task's latency requirements to the child task Date: Sun, 8 Dec 2019 11:34:09 +0530 X-Mailer: git-send-email 2.17.2 In-Reply-To: <20191208060410.17814-1-parth@linux.ibm.com> References: <20191208060410.17814-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19120806-0028-0000-0000-000003C6747E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19120806-0029-0000-0000-000024899D02 Message-Id: <20191208060410.17814-3-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-08_01:2019-12-05,2019-12-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=954 lowpriorityscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 phishscore=0 bulkscore=0 clxscore=1015 adultscore=0 spamscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912080054 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 Reviewed-by: Qais Yousef --- kernel/sched/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2da6a005bb3f..3f9359d0e326 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