Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2301550ybh; Fri, 24 Jul 2020 09:19:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLNcrb4KD9OiHsTer6f+GwbO/nPSgmjM4lIqfiuYFehoLMp9mXdCZ6I7WAP1cAqn6WofRE X-Received: by 2002:a05:6402:2350:: with SMTP id r16mr9230209eda.62.1595607559152; Fri, 24 Jul 2020 09:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595607559; cv=none; d=google.com; s=arc-20160816; b=brwk4KOapgetOGLdNZ1+7pGsDTcT7+NSQu97ooZnQtDR4Egaap07Ts/Tzzz85frPmU mAHSt+kfP6r6eMfbhWu0Wi5/z1NnSpKnGeMCMfN/s4dx9vdIbtWagtYXKWbgVErnn3Et tYE1fJsmlAyS85zKMvkJcGDCFmsqSdmX50eDheWnqzmx7niU8K8BlghvY6dtORlGH2Mp Sujh8AgKREua4+TvK034x3ZdHF0EZQHOQXSLAUaDOZpJ9HG0cIYV0oAQpCljWnvFAr1K A32mygzU4BO6tjFdEc4WZOgmxMDJTTndkZ1lmmNTPzpC3FZ794ADxAFjL0atc416/9q+ CmoA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Ge7EfDOOXb6s5hxWaPUSjcx42cCYRnWRNvAJBl+/uHE=; b=U+yKNXDpMUZbX4fuY9vHRK10MH2VDMQAs5Qmb2uH4jm5S1dwXYTi+1TqMG2R9qSLSi umSyzZjPRHKmZT6kbzAeYWaw7PjQJJ4bmyIoYUkR8SewiDso0ynCbrGEz5qp2z/0TsCs uwZeBE2qVSyBSiX5FSzlw76uMadJdAyQsnepyrvsLaJuwv5PSKyUwCuG2pmdPb7q6Hbf ggQpf3Tx7SxAHe/NLMuWWiKG2cK8RR/n4M/7VuANtvaJ4TtJAc/9PlX/rTZkjjgBvLSu hK5I/4+kwddy99ARJK4Co0wZzt18SGZKdJfLUJxhK6skLirx5x6EdvC9Hw3kTLM9EdU0 h3bg== 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 x94si857153ede.416.2020.07.24.09.18.56; Fri, 24 Jul 2020 09:19:19 -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 S1726617AbgGXQSJ (ORCPT + 99 others); Fri, 24 Jul 2020 12:18:09 -0400 Received: from foss.arm.com ([217.140.110.172]:36690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGXQSJ (ORCPT ); Fri, 24 Jul 2020 12:18:09 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 091DDD6E; Fri, 24 Jul 2020 09:18:08 -0700 (PDT) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 831833F66F; Fri, 24 Jul 2020 09:18:06 -0700 (PDT) Subject: Re: [PATCH] sched/deadline: dome some cleanup for push_dl_task() To: Daniel Bristot de Oliveira , Juri Lelli , Peng Liu Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de References: <20200706160442.GA19741@iZj6chx1xj0e0buvshuecpZ> <20200724071426.GD14912@localhost.localdomain> <16385ed9-eb44-3ea4-b10a-1e5ef993b33e@redhat.com> From: Dietmar Eggemann Message-ID: <6f4c7154-f850-c8ee-6def-83dfa6bc4341@arm.com> Date: Fri, 24 Jul 2020 18:18:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <16385ed9-eb44-3ea4-b10a-1e5ef993b33e@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/07/2020 17:31, Daniel Bristot de Oliveira wrote: > On 7/24/20 9:14 AM, Juri Lelli wrote: >> Hi, >> >> On 07/07/20 00:04, Peng Liu wrote: >>> 'commit 840d719604b0 ("sched/deadline: Update rq_clock of later_rq when pushing a task")' >>> introduced the update_rq_clock() to fix the "used-before-update" bug. >>> >>> 'commit f4904815f97a ("sched/deadline: Fix double accounting of rq/running bw in push & pull")' >>> took away the bug source(add_running_bw()). >>> >>> We no longer need to update rq_clock in advance, let activate_task() >>> worry about that. >>> >>> Signed-off-by: Peng Liu >>> --- >>> kernel/sched/deadline.c | 8 +------- >>> 1 file changed, 1 insertion(+), 7 deletions(-) >>> >>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c >>> index 504d2f51b0d6..c3fa11f84d93 100644 >>> --- a/kernel/sched/deadline.c >>> +++ b/kernel/sched/deadline.c >>> @@ -2104,13 +2104,7 @@ static int push_dl_task(struct rq *rq) >>> >>> deactivate_task(rq, next_task, 0); >>> set_task_cpu(next_task, later_rq->cpu); >>> - >>> - /* >>> - * Update the later_rq clock here, because the clock is used >>> - * by the cpufreq_update_util() inside __add_running_bw(). >>> - */ >>> - update_rq_clock(later_rq); >>> - activate_task(later_rq, next_task, ENQUEUE_NOCLOCK); >>> + activate_task(later_rq, next_task, 0); >>> ret = 1; >> The change looks good to me, since now add_running_bw() is called later >> by enqueue_task_dl(), but rq_clock has already been updated by core's >> enqueue_task(). >> >> Daniel, Dietmar, a second pair of eyes (since you authored the commits >> above)? >> >> I'd chage subject to something like "sched/deadline: Stop updating >> rq_clock before pushing a task". > > Looks good to me! > > Acked-by: Daniel Bristot de Oliveira Yes, makes sense to me! Reviewed-by: Dietmar Eggemann