Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7689465ybl; Thu, 16 Jan 2020 04:05:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxit/D9mh+Tlr58i5VOyYpWCqv+SUXAwVO0jleAXe3VlW8tFSTS+v/F3TB+9dD29Pq7c3H+ X-Received: by 2002:aca:d507:: with SMTP id m7mr3680766oig.48.1579176307122; Thu, 16 Jan 2020 04:05:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579176307; cv=none; d=google.com; s=arc-20160816; b=RJ4pIS+yQoyMqXJCaGWpADc/6H0FxuDbT5qMUMn9dUm7/TV1DP2aTT+l3c7tK7IFEu 7xMef2YQJiMQosSaeU0uggE34XzXvtTXD42Y96pYT0J/Rn87fE0JjjxbyKdnQy0STlV6 LshmOE+Aq08oz1063h01FlYq3/dM9IMat8xKtII7hG2RNnuyqL1mvXSOSDiad5ye+fEt oDJWFcEMzeQpD/gNjomzwMw/U8dOtac2FpqTJufH6ub6mfMgrjYabDEDXaQ0uL0QIScd YTtyzr0IrRMQG4lA40gCKN7qBWZzRb9cKXU+U/YWHYAZ6khIKs/bq6iwTW6ak/N8TUDU Qgsw== 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=DXlokOiKMEjfHQnSf/HnetU1yBSxxOjTlB+KrvXyP0A=; b=ND5Q0iig2mQGxjHUGJ8iWUX2Ix0nTIVH8aFD+7UZBmS265Suqzt4hwp0i1zq/SnwCe Tw28P9sGpRJj8AzlZMCbDzZawbDd4mvLNzrIwVzvYdt4GbIJoeSLJTBowoQAWkcW71N9 2h/QfHGv1wSYhc2t1UlAz3I1j1qCb7ResaZXNp5VkAu2ixODStnTkmrv8+RMn1PLSj/v YR0lrfjGY8bibz5HGLnoAufTaHxk6brvVhHoM6tpZDW/ADK84Eslx/T8oBkQ/NGiWkUv 7noiic/HzOtZjOvg6+rwux418vkYCkwIAd20cMdnM/XcishVndS/FQukQb1Atw8QXanF lmPA== 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 z16si12852930oti.143.2020.01.16.04.04.55; Thu, 16 Jan 2020 04:05:07 -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 S1726898AbgAPMCr (ORCPT + 99 others); Thu, 16 Jan 2020 07:02:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:30474 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726885AbgAPMCq (ORCPT ); Thu, 16 Jan 2020 07:02:46 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00GBvV6W118021 for ; Thu, 16 Jan 2020 07:02:45 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2xhgs7uk3d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Jan 2020 07:02:45 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Jan 2020 12:02:43 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) 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) Thu, 16 Jan 2020 12:02:39 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00GC2cSg53084192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2020 12:02:38 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6079BA4057; Thu, 16 Jan 2020 12:02:38 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1CFC9A4051; Thu, 16 Jan 2020 12:02:36 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.120]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 16 Jan 2020 12:02:35 +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 v3 2/3] sched/core: Propagate parent task's latency requirements to the child task Date: Thu, 16 Jan 2020 17:32:29 +0530 X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200116120230.16759-1-parth@linux.ibm.com> References: <20200116120230.16759-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20011612-0012-0000-0000-0000037DDA98 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20011612-0013-0000-0000-000021BA0E59 Message-Id: <20200116120230.16759-3-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-16_03:2020-01-16,2020-01-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 malwarescore=0 suspectscore=1 mlxlogscore=926 impostorscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001160103 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clone parent task's latency_nice attribute to the forked child task. Reset the latency_nice 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 e7b08d52db93..a7359836bf17 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2854,6 +2854,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_nice = current->latency_nice; + uclamp_fork(p); /* @@ -2870,6 +2873,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_nice = DEFAULT_LATENCY_NICE; /* * We don't need the reset flag anymore after the fork. It has * fulfilled its duty: -- 2.17.2