From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932481AbcFCKse (ORCPT ); Fri, 3 Jun 2016 06:48:34 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55946 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932397AbcFCKsc (ORCPT ); Fri, 3 Jun 2016 06:48:32 -0400 Date: Fri, 3 Jun 2016 03:47:33 -0700 From: tip-bot for Xunlei Pang Message-ID: Cc: peterz@infradead.org, rostedt@goodmis.org, mingo@kernel.org, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, xlpang@redhat.com, juri.lelli@arm.com, efault@gmx.de Reply-To: efault@gmx.de, juri.lelli@arm.com, xlpang@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, peterz@infradead.org, rostedt@goodmis.org, mingo@kernel.org In-Reply-To: <1462885398-14724-1-git-send-email-xlpang@redhat.com> References: <1462885398-14724-1-git-send-email-xlpang@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Fix the wrong throttled clock time for cfs_rq_clock_task() Git-Commit-ID: 1a99ae3f00d3c7c7885ee529ac9a874b19caa0cf 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1a99ae3f00d3c7c7885ee529ac9a874b19caa0cf Gitweb: http://git.kernel.org/tip/1a99ae3f00d3c7c7885ee529ac9a874b19caa0cf Author: Xunlei Pang AuthorDate: Tue, 10 May 2016 21:03:18 +0800 Committer: Ingo Molnar CommitDate: Fri, 3 Jun 2016 09:18:56 +0200 sched/fair: Fix the wrong throttled clock time for cfs_rq_clock_task() Two minor fixes for cfs_rq_clock_task(): 1) If cfs_rq is currently being throttled, we need to subtract the cfs throttled clock time. 2) Make "throttled_clock_task_time" update SMP unrelated. Now UP cases need it as well. Signed-off-by: Xunlei Pang Signed-off-by: Peter Zijlstra (Intel) Cc: Juri Lelli Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1462885398-14724-1-git-send-email-xlpang@redhat.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 218f8e8..1e87bb6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3688,7 +3688,7 @@ static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg) static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq) { if (unlikely(cfs_rq->throttle_count)) - return cfs_rq->throttled_clock_task; + return cfs_rq->throttled_clock_task - cfs_rq->throttled_clock_task_time; return rq_clock_task(rq_of(cfs_rq)) - cfs_rq->throttled_clock_task_time; } @@ -3826,13 +3826,11 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of(rq)]; cfs_rq->throttle_count--; -#ifdef CONFIG_SMP if (!cfs_rq->throttle_count) { /* adjust cfs_rq_clock_task() */ cfs_rq->throttled_clock_task_time += rq_clock_task(rq) - cfs_rq->throttled_clock_task; } -#endif return 0; }