Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3390761ybd; Tue, 25 Jun 2019 01:35:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDMr4pEDnDqeMzCG239z3XYhLTaCjW8XA8dXO3RFT10oiKjb/X39OgDGWKyNksu9hj+tNW X-Received: by 2002:a65:534b:: with SMTP id w11mr38323847pgr.210.1561451753267; Tue, 25 Jun 2019 01:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561451753; cv=none; d=google.com; s=arc-20160816; b=KQa38VOK+4QO7csletg42Rp/aJ68ML3/XjfI+beExw+nQ0B6YAiIy/o+eYhdTQHq/f MdjxOZhLZ5ejBzwZEyIWN+g2URwLEEpQg6BFuXOS40kCSdwiZQDPeeHklFwcinRqJ1Je AIKJsdi7ZZubYwPwVAal5+HZZNZ4JlpnfCvpfXjmRPfRCDaXvAUQWW6qbmn6jhx39dMG /kzIOd58iuTgoDZnRY+c5z8+ZdjYPjRy/z6nqvp/5oUBg3huHLqGbZvhHma33Cbe8HBg n3ejW+eJZAIsrhRcyi0CRRsGws7MDtp5fWXDbEGygUYO3phNIU+sabkbDjHHGqU2/x3i gEFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=fiP9agSJnu7+gpj/PqGK/hhgB0/v2ahUu3gAqA2yZws=; b=fKousNax798LDmlKlg5cGeDt0YiK9DuZITwdOmOtkszAQiI6oq/NvqO+bRczH6BRLV hHvlJiiJXBXbpX4IKZe6TWDzDmf28hOj9XGtG/1O7zYO1ESEKWUWZjjeST40nztx81rb aMFfCJ7R5gSj64456+HL1W4MbIv1krZZzFH5r2xc7WEi7EjrmEexT8ZaJE8LnlATWet3 BBxHfpApebqs/HDpaCCgO6TGNxZsLihfuSQQpfrJwXP5QrnONAe7uHZC1HZuKB0gfuO8 UUoNmIEWpU6eNzKZ3xlGFUmCKw1OChe9etpPXHclZ4s9+iknElVb/Wtgid1/VOFl8vxJ m4Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=KNzfVUUp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be11si12157252plb.218.2019.06.25.01.35.37; Tue, 25 Jun 2019 01:35:53 -0700 (PDT) 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; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=KNzfVUUp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730599AbfFYIfE (ORCPT + 99 others); Tue, 25 Jun 2019 04:35:04 -0400 Received: from terminus.zytor.com ([198.137.202.136]:55531 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfFYIfD (ORCPT ); Tue, 25 Jun 2019 04:35:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5P8YJ8g3531510 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 25 Jun 2019 01:34:19 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5P8YJ8g3531510 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1561451660; bh=fiP9agSJnu7+gpj/PqGK/hhgB0/v2ahUu3gAqA2yZws=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=KNzfVUUpbaQpFdTtIxtMX1cK5+X/yGbhNZcTzZkit5EsskbZgg1lwi3eIBFJ0v2Tb ZH4ZuTpdZdnZp9Xetw7PPtkBU84jjvaOqVyxNBI1wTsAXflufBWPLfwxAJq3g3dt5v 1DEaXH4KmKFSXtviOknjftIH93cYjl6+xofLY5hBbcRUwXJgNs91N/8ODAfkt7E6Fh 3+Y2rPqew0YgNtbdYKvg+toE9fMLFdXEZeDYKUW3KhOYpkT13zJX3BPQcq7LQkBqp2 iJN79w/Pk4lmYvkYkMsWBLs0nVltIGpaeiQgbDIEMpvUPugNieT7T2KR33vPTelDUO xS4LtM5xobuig== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5P8YJKp3531507; Tue, 25 Jun 2019 01:34:19 -0700 Date: Tue, 25 Jun 2019 01:34:19 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Patrick Bellasi Message-ID: Cc: viresh.kumar@linaro.org, hpa@zytor.com, pjt@google.com, vincent.guittot@linaro.org, tkjos@google.com, linux-kernel@vger.kernel.org, smuckle@google.com, peterz@infradead.org, mingo@kernel.org, joelaf@google.com, tglx@linutronix.de, dietmar.eggemann@arm.com, balsini@android.com, quentin.perret@arm.com, patrick.bellasi@arm.com, morten.rasmussen@arm.com, rafael.j.wysocki@intel.com, tj@kernel.org, juri.lelli@redhat.com, surenb@google.com, torvalds@linux-foundation.org Reply-To: dietmar.eggemann@arm.com, balsini@android.com, tglx@linutronix.de, morten.rasmussen@arm.com, quentin.perret@arm.com, patrick.bellasi@arm.com, rafael.j.wysocki@intel.com, tj@kernel.org, juri.lelli@redhat.com, surenb@google.com, torvalds@linux-foundation.org, viresh.kumar@linaro.org, hpa@zytor.com, pjt@google.com, vincent.guittot@linaro.org, tkjos@google.com, smuckle@google.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, joelaf@google.com In-Reply-To: <20190621084217.8167-8-patrick.bellasi@arm.com> References: <20190621084217.8167-8-patrick.bellasi@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/uclamp: Reset uclamp values on RESET_ON_FORK Git-Commit-ID: a87498ace58e23b62a572dc7267579ede4c8495c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a87498ace58e23b62a572dc7267579ede4c8495c Gitweb: https://git.kernel.org/tip/a87498ace58e23b62a572dc7267579ede4c8495c Author: Patrick Bellasi AuthorDate: Fri, 21 Jun 2019 09:42:08 +0100 Committer: Ingo Molnar CommitDate: Mon, 24 Jun 2019 19:23:47 +0200 sched/uclamp: Reset uclamp values on RESET_ON_FORK A forked tasks gets the same clamp values of its parent however, when the RESET_ON_FORK flag is set on parent, e.g. via: sys_sched_setattr() sched_setattr() __sched_setscheduler(attr::SCHED_FLAG_RESET_ON_FORK) the new forked task is expected to start with all attributes reset to default values. Do that for utilization clamp values too by checking the reset request from the existing uclamp_fork() call which already provides the required initialization for other uclamp related bits. Signed-off-by: Patrick Bellasi Signed-off-by: Peter Zijlstra (Intel) Cc: Alessio Balsini Cc: Dietmar Eggemann Cc: Joel Fernandes Cc: Juri Lelli Cc: Linus Torvalds Cc: Morten Rasmussen Cc: Paul Turner Cc: Peter Zijlstra Cc: Quentin Perret Cc: Rafael J . Wysocki Cc: Steve Muckle Cc: Suren Baghdasaryan Cc: Tejun Heo Cc: Thomas Gleixner Cc: Todd Kjos Cc: Vincent Guittot Cc: Viresh Kumar Link: https://lkml.kernel.org/r/20190621084217.8167-8-patrick.bellasi@arm.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e9a669266fa9..ecc304ab906f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1082,6 +1082,14 @@ static void uclamp_fork(struct task_struct *p) for_each_clamp_id(clamp_id) p->uclamp[clamp_id].active = false; + + if (likely(!p->sched_reset_on_fork)) + return; + + for_each_clamp_id(clamp_id) { + uclamp_se_set(&p->uclamp_req[clamp_id], + uclamp_none(clamp_id), false); + } } static void __init init_uclamp(void)