Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5909595ybi; Wed, 31 Jul 2019 05:18:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaV591eLSxg9rX/hbZYv2P6Vfdm13HEA4vhByXA1xEOo4jZH/ATwTx/AKEzA6lzqYxb/N8 X-Received: by 2002:aa7:81d9:: with SMTP id c25mr47975289pfn.255.1564575509113; Wed, 31 Jul 2019 05:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564575509; cv=none; d=google.com; s=arc-20160816; b=wIiS7/+EFvuxAFftgv9r4nVALE3iQ1GbpBB+N65i+mW64GzVrhR9oSDhxFeml7I9Ht MxYbzC4U9HeDc8jiwQhScWGdzzLLOcMhwVb8NvMzyQD0wZXf2xPXP/5b4b6xBKk9+K5B uoS9BBG6VdR+eZ67ImmE2wjW98f5i3K1loPU1Cy2x+FbpNWHtNPcDg6UdSyt/UQTSpmc 4pm0+Sk9GqAdNdCiAc5sLoiq1vLc/m5YIo5CMur6fOJ8qkG8VebFEqwAf4blsZ0H1U3H MJxUH5QPrjLUSz6GVhnZy35IeRCoBRS7wR2iUJ6Y1F4ZweIJJH6avcHeissM0a3zhmzb Vmsw== 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:references:cc:to:from:subject; bh=bjUzLUCe7PHFcX/KV8Lpp/f5p8I1SYpErWtOYrLguoY=; b=vJWLeqpNtJPgEOmm6pqz1sNSesYTnDHnatemt/rTj2ulPqzAjZOdfnlbIuN//GIQHQ WxQdV/on4H12B/oXXpAOZtC0l9N3M8wdzSdG5nVd1TQsKSXYZu/Dk7/gXtqbmX1OchFK 0cTClHIr3I4+3PmPMsWNlOnu+2CdRbzALSrK9HiUdL5c3Q/QSn6AjrptlmgfIwxj7NaL /08zxv85BxMq9jMxp4Tfc1w+fSiIBTfJCG9Fa7yeRBAK2XyEBt4N48LWLlfCcbi9F2hh 9x0k8+n1x3EcnfgEOehJ1Q3jx3Bm0PJlwwtB/2HUcrMchiqHE6/DQHrsyLLn9HYsUrNE S1Wg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si3243167pll.279.2019.07.31.05.18.14; Wed, 31 Jul 2019 05:18:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387605AbfGaKdC (ORCPT + 99 others); Wed, 31 Jul 2019 06:33:02 -0400 Received: from foss.arm.com ([217.140.110.172]:44002 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfGaKdB (ORCPT ); Wed, 31 Jul 2019 06:33:01 -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 E8B0B337; Wed, 31 Jul 2019 03:33:00 -0700 (PDT) Received: from [10.1.31.37] (C02VH2K2HV2R.cambridge.arm.com [10.1.31.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC5063F71F; Wed, 31 Jul 2019 03:32:59 -0700 (PDT) Subject: Re: [PATCH 1/5] sched/deadline: Fix double accounting of rq/running bw in push_dl_task() From: Dietmar Eggemann To: luca abeni Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Daniel Bristot de Oliveira , Valentin Schneider , Qais Yousef , linux-kernel@vger.kernel.org References: <20190726082756.5525-1-dietmar.eggemann@arm.com> <20190726082756.5525-2-dietmar.eggemann@arm.com> <20190726153002.5e49c666@sweethome> <213a5bb3-208a-b8dc-0c80-175ceb4ae1dd@arm.com> Message-ID: <7cb2132f-a5bc-a5d8-6328-cf74b80352dc@arm.com> Date: Wed, 31 Jul 2019 11:32:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <213a5bb3-208a-b8dc-0c80-175ceb4ae1dd@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/19 10:00 AM, Dietmar Eggemann wrote: > On 7/26/19 2:30 PM, luca abeni wrote: >> Hi, >> >> On Fri, 26 Jul 2019 09:27:52 +0100 >> Dietmar Eggemann wrote: >> [...] >>> @@ -2121,17 +2121,13 @@ static int push_dl_task(struct rq *rq) >>> } >>> >>> deactivate_task(rq, next_task, 0); >>> - sub_running_bw(&next_task->dl, &rq->dl); >>> - 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(). >>> */ >>> update_rq_clock(later_rq); >>> - add_running_bw(&next_task->dl, &later_rq->dl); >> >> Looking at the code again and thinking a little bit more about this >> issue, I suspect a similar change is needed in pull_dl_task() too, no? > > The code looks the same. Let me try to test it. I will add it in v2 then. Like you expected, it happens on the pull side as well. [ 129.813720] --> CPU7: pull_dl_task: p=[thread0-6 1313] dl_bw=125829 src_rq->dl.running_bw=251658 this_rq->dl.running_bw=125829 [ 129.825167] <-- CPU7: pull_dl_task: p=[thread0-6 1313] dl_bw=125829 src_rq->dl.running_bw=0 this_rq->dl.running_bw=377487 ... [ 129.948528] dl_rq->running_bw > old [ 129.948568] WARNING: CPU: 7 PID: 0 at kernel/sched/deadline.c:117 inactive_task_timer+0x5e8/0x6b8 ... [ 130.077158] inactive_task_timer+0x5e8/0x6b8 [ 130.081427] __hrtimer_run_queues+0x12c/0x398 [ 130.085782] hrtimer_interrupt+0xfc/0x330 ...