From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:35256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbeHBEev (ORCPT ); Thu, 2 Aug 2018 00:34:51 -0400 Date: Wed, 1 Aug 2018 22:45:56 -0400 From: Steven Rostedt To: Kirill Tkhai Cc: Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, Juri Lelli , Luca Abeni , Tommaso Cucinotta , Peter Zijlstra , Ingo Molnar , stable@vger.kernel.org Subject: Re: [PATCH V2] sched/deadline: Update rq_clock of later_rq when pushing a task Message-ID: <20180801224556.2d0b9342@vmware.local.home> In-Reply-To: <12b65bbb-e82a-7fa5-1225-5047096d48f8@virtuozzo.com> References: <52d533238eb69a09fbf40b34765be312e0fd0296.1531490101.git.bristot@redhat.com> <12b65bbb-e82a-7fa5-1225-5047096d48f8@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Mon, 16 Jul 2018 13:45:21 +0300 Kirill Tkhai wrote: > > --- a/kernel/sched/deadline.c > > +++ b/kernel/sched/deadline.c > > @@ -2090,8 +2090,16 @@ static int push_dl_task(struct rq *rq) > > sub_rq_bw(&next_task->dl, &rq->dl); > > set_task_cpu(next_task, later_rq->cpu); > > add_rq_bw(&next_task->dl, &later_rq->dl); > > + > > + /* > > + * Update the later_rq clock here, because the clock is used > > + * by the cpufreq_update_util() inside __add_running_bw(). > > + * Then, set ENQUEUE_NOCLOCK flag to avoid updating the rq_clock > > + * again in the activate_task()->enqueue_task(). > > Is the second sentence really needed? It seems everybody knows, what NOCLOCK > flag does, and we does not have to paraphrase this in every place it's used :) I would keep the mention, but change the comment: /* * Update the later_rq clock before calling add_running_bw() * because the clock is used by cpufreq_update_util() that is * inside __add_running_bw(). As the later_rq clock is already * updated, we need to set ENQUEUE_NOCLOCK to prevent * activate_task() from updating it again. */ Other than that... Acked-by: Steven Rostedt (VMware) -- Steve > > > + */ > > + update_rq_clock(later_rq); > > add_running_bw(&next_task->dl, &later_rq->dl); > > - activate_task(later_rq, next_task, 0); > > + activate_task(later_rq, next_task, ENQUEUE_NOCLOCK); > > ret = 1; > > > > resched_curr(later_rq);