Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2202153ybv; Mon, 24 Feb 2020 01:00:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwYsPbN2rzatqvPTiCEQegyC/hVIsUCsIHpjTH3P/tI/SDbVfH/htO+8siqHPITzseWwiqa X-Received: by 2002:a9d:7999:: with SMTP id h25mr38967421otm.347.1582534803391; Mon, 24 Feb 2020 01:00:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582534803; cv=none; d=google.com; s=arc-20160816; b=wct5um4GiJjJpeWe1WkyPBQ6NrBj8oC9faDXEFm1d3fLkGxdTL0D4d4Ta+FJD6iNMU BmSmBqj2/uYyE71mBpA7UbZw8/8D/L1+ebOZkB0JsN9aZC2hfiuVrUlqJbqy1kvpoCKd SkpqgdXY+sHK05baK+BTX2LMslTsc37EE2FZeG8FcNaBZecEq+XSTNDr1n7fF0q7wClu ym3PhGXGHOMvryB5qEv8V1Q2sNY8kSvrYYwnT5DUQAN/283lZy5oq13+VxUKoHRNtex4 n6auevWTBskCk4ex0kBlV4hYuCh/hHDRr/2CZ6XmfrgqOGQdU+AzYdAsljEkcf+xnYwE aTfw== 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=8Ze/+m12GPaUAzp0RQYXQ+hNCENhgpINdNdRQ2uIYEI=; b=ODeFkA0LxKQfDXuqoKXFTotAEhNc85g8tPl6pH/Ase5ILhglrBV/nPgTRPfLDK9DZu JmTjmEbiwWFa5msiQ9oVSXJlZR/Rf1RPZrZh1FJzntxB5z40w746X5xJ1/aQLf0TlY2G e87cSPzBdRfwXlWsqCD9sKOLf9SmYGssjCd5AMH5SUyD/Sn9uP5t55KHt+bEs3MTBy+S CtRmNG7AZML9AZzxCd5zxJltQHgdtrWFsHdpWgxT8jYDvTbvUd+Qb/Einwj73ctIcg9d AZpm3nNpF5mae4ptLuP1U1JNYn4f2a7l6A75Vk/PwFJtwZ0dYybFFB+20W2A7JOGfto+ WtYA== 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 f141si4716536oib.125.2020.02.24.00.59.51; Mon, 24 Feb 2020 01:00:03 -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 S1727327AbgBXI7i (ORCPT + 99 others); Mon, 24 Feb 2020 03:59:38 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20112 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727276AbgBXI7g (ORCPT ); Mon, 24 Feb 2020 03:59:36 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01O8oix6145400 for ; Mon, 24 Feb 2020 03:59:35 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yb1qc6w0s-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Feb 2020 03:59:35 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Feb 2020 08:59:33 -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) Mon, 24 Feb 2020 08:59:28 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01O8xRnY51511500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Feb 2020 08:59:27 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2965842042; Mon, 24 Feb 2020 08:59:27 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 919144203F; Mon, 24 Feb 2020 08:59:24 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.160]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 24 Feb 2020 08:59:24 +0000 (GMT) From: Parth Shah To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, qais.yousef@arm.com, chris.hyser@oracle.com, patrick.bellasi@matbug.net, valentin.schneider@arm.com, David.Laight@ACULAB.COM, pjt@google.com, pavel@ucw.cz, tj@kernel.org, dhaval.giani@oracle.com, qperret@google.com, tim.c.chen@linux.intel.com Subject: [PATCH v4 2/4] sched/core: Propagate parent task's latency requirements to the child task Date: Mon, 24 Feb 2020 14:29:16 +0530 X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200224085918.16955-1-parth@linux.ibm.com> References: <20200224085918.16955-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20022408-0012-0000-0000-00000389B4C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20022408-0013-0000-0000-000021C6534D Message-Id: <20200224085918.16955-3-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-24_02:2020-02-21,2020-02-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=1 phishscore=0 mlxlogscore=924 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002240078 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 377ec26e9159..65b6c00d6dac 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2860,6 +2860,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); /* @@ -2876,6 +2879,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