Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1138746ybz; Wed, 22 Apr 2020 14:22:12 -0700 (PDT) X-Google-Smtp-Source: APiQypIdA/pHw5ZZCxXkreYuhrtqi7qfN3yzfFign6ZDtvUzIs5+D9z+R+FhgR+rBOqZpbakoJzK X-Received: by 2002:a17:906:3004:: with SMTP id 4mr251749ejz.381.1587590531885; Wed, 22 Apr 2020 14:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587590531; cv=none; d=google.com; s=arc-20160816; b=vZeiicFw+bdl4ABn4VVkkQ2hq05cHmqib1JFRxs5lxomuEGYG7G3wkaMVs7+J1jdkP dgaWXMKRr11NwQith7cEKRTJy5heiJiaXsbLugid2sQWF5aqqpJmAzCytm3i9+F3R6MI n6aWm2uT2zEGetWXm5F9vdGg6Ev76Hz/yPB+lxkKInZcbEp2864uFYv5dGC9GIAaxuEk 35Uq1b8V4MU7/DjteRwfcfL9jdbwhPLszIc4AhrabI2d9PkBnpjNPCRjtkqbDDyUOVPz sa3Ani1+97Wepqgt2vKpDTc/XJHAw7aHy9OSmFcLzEqtFgY6PclMBp0LnEbdzNI0xcJP 1FtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=ZIAXt1qEhKNuJW/TT3PllEUH61+d5pIBo0695zeiBwQ=; b=guTvL8NJAr1M4aTUt33xWJq8edj0Bj55ASB/I1mHuLIXKLltDIykPLtg1I7DEjdix7 eAoN7QTqwg9v9XJ5V64W8ICfy1GHkC+TtwJoftvfD5Ps1xV9C9S5CwS7SKBCyHO0vwGi OfeOSAUBBCOHHuiIOob4SouiJ+tIGRkC9R+8QgZgLl3XI2XKJtsMgLM+cGAIZqXHPZnT 2e1cByi8fldh60t2EfHF/3DlnwbZh2aZXrO+I4VFjWKPCg0ma6QC8TgGgMex/PuGFsZB rlPV0+QZw9qXBNctm7522q9hst9GFkp3MmkA4MB5CIS3ByI3iqIUHmql1d/AxOOKaSlj XjSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si155140edu.287.2020.04.22.14.21.47; Wed, 22 Apr 2020 14:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbgDVVUy (ORCPT + 99 others); Wed, 22 Apr 2020 17:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgDVVUx (ORCPT ); Wed, 22 Apr 2020 17:20:53 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C60BEC03C1A9; Wed, 22 Apr 2020 14:20:53 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jRMnX-0000Nl-Tw; Wed, 22 Apr 2020 23:20:48 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 88EE81C0450; Wed, 22 Apr 2020 23:20:47 +0200 (CEST) Date: Wed, 22 Apr 2020 21:20:47 -0000 From: "tip-bot2 for Quentin Perret" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/core: Fix reset-on-fork from RT with uclamp Cc: Chitti Babu Theegala , Quentin Perret , "Peter Zijlstra (Intel)" , Patrick Bellasi , Dietmar Eggemann , x86 , LKML In-Reply-To: <20200416085956.217587-1-qperret@google.com> References: <20200416085956.217587-1-qperret@google.com> MIME-Version: 1.0 Message-ID: <158759044717.28353.7054325009828879499.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: eaf5a92ebde5bca3bb2565616115bd6d579486cd Gitweb: https://git.kernel.org/tip/eaf5a92ebde5bca3bb2565616115bd6d579486cd Author: Quentin Perret AuthorDate: Thu, 16 Apr 2020 09:59:56 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 22 Apr 2020 23:10:13 +02:00 sched/core: Fix reset-on-fork from RT with uclamp uclamp_fork() resets the uclamp values to their default when the reset-on-fork flag is set. It also checks whether the task has a RT policy, and sets its uclamp.min to 1024 accordingly. However, during reset-on-fork, the task's policy is lowered to SCHED_NORMAL right after, hence leading to an erroneous uclamp.min setting for the new task if it was forked from RT. Fix this by removing the unnecessary check on rt_task() in uclamp_fork() as this doesn't make sense if the reset-on-fork flag is set. Fixes: 1a00d999971c ("sched/uclamp: Set default clamps for RT tasks") Reported-by: Chitti Babu Theegala Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Patrick Bellasi Reviewed-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20200416085956.217587-1-qperret@google.com --- kernel/sched/core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3a61a3b..9a2fbf9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1232,13 +1232,8 @@ static void uclamp_fork(struct task_struct *p) return; for_each_clamp_id(clamp_id) { - unsigned int clamp_value = uclamp_none(clamp_id); - - /* By default, RT tasks always get 100% boost */ - if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN)) - clamp_value = uclamp_none(UCLAMP_MAX); - - uclamp_se_set(&p->uclamp_req[clamp_id], clamp_value, false); + uclamp_se_set(&p->uclamp_req[clamp_id], + uclamp_none(clamp_id), false); } }