Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7065411ybi; Mon, 22 Jul 2019 06:34:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZGrlbP9k1jhsyA3dhPJAhifXgcEWWA3ePTkEdwYUoNuZXGowXXf4XfswSI6RYMv9Pqos9 X-Received: by 2002:a63:9249:: with SMTP id s9mr69392751pgn.356.1563802466485; Mon, 22 Jul 2019 06:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563802466; cv=none; d=google.com; s=arc-20160816; b=l3aGqePHGaggBxrcpPDese6Yv0+bpKZKvy4DFbKsngycsKUDcAWjV6V1bVOZLbpwXm mkEOokVNodGQj6tIH24RPtVoV1dFQowTtKAVireU4oe7KNxKqk4b1As7N4kBHC5Xiuwj eadpBqn+DmSt60NQAo8sDFG+OIWz3p/1dsUgBR6jiGLKz0Gi/vWCA8MAKn2kubDnF276 qkiLg0hXRUJZCSoQf9UqmCLOQdop+J2yohwc5CKmL5Nf8aHX31BccVtN4KbEK0pYoXX5 5jH4Ycc8aV9Nb8TlcnqJ+PuxDaACwpqXfeEBfVgYZROGY3wgP+53wo9ISzVTx3TsUFEs SBbA== 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=hvIuo+AB52JovJdMsBTEYxQi53xvqDnkYB3E1KpoVRQ=; b=WHw2Y4s7J3M5Tft79wuR4w53DTjXYsU1mL8EdI5THpR8PQ6NZymj5nqTXMeoyKMMZ1 CvyPQ5ovHhRRepc8nSGAkZF+Zjknvtyotrp3PeL1I2Zi5pcirF3satZxZnM+8vCvSQG5 Cw0mOaarnMvDyXbM7bYF4Y3tUGaFP8/f9dj98KlI3KyiWcuwi4PA6rWG+MnPLKmG916V AjmVlHwmvaROpNG0U0ij3zJpMz8ql+PajTFoz/dy2Jhhi5jqoroeKB51cX2gvpSewBBP 8ok3UePac9ZEk290V8mRu/P0F5oyhW3Hogk1wBizAHulugeHteaudoCXmKTQWQEvjDX7 Nh2g== 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 o39si8500252pje.28.2019.07.22.06.34.10; Mon, 22 Jul 2019 06:34:26 -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 S1728602AbfGVNVw (ORCPT + 99 others); Mon, 22 Jul 2019 09:21:52 -0400 Received: from foss.arm.com ([217.140.110.172]:37402 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728103AbfGVNVw (ORCPT ); Mon, 22 Jul 2019 09:21:52 -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 417BC344; Mon, 22 Jul 2019 06:21:51 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.194.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE9013F71A; Mon, 22 Jul 2019 06:21:48 -0700 (PDT) Subject: Re: [PATCH v9 4/8] sched/deadline: Fix bandwidth accounting at all levels after offline migration To: Juri Lelli Cc: peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, tj@kernel.org, linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, lizefan@huawei.com, longman@redhat.com, cgroups@vger.kernel.org References: <20190719140000.31694-1-juri.lelli@redhat.com> <20190719140000.31694-5-juri.lelli@redhat.com> <5da6abab-00ff-9bb4-f24b-0bf5dfcd4c35@arm.com> <20190722122828.GG25636@localhost.localdomain> From: Dietmar Eggemann Message-ID: <07a45864-07bf-aa5d-3ff7-a300326b9040@arm.com> Date: Mon, 22 Jul 2019 15:21:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190722122828.GG25636@localhost.localdomain> 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/22/19 2:28 PM, Juri Lelli wrote: > On 22/07/19 13:07, Dietmar Eggemann wrote: >> On 7/19/19 3:59 PM, Juri Lelli wrote: >> >> [...] >> >>> @@ -557,6 +558,38 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p >>> double_lock_balance(rq, later_rq); >>> } >>> >>> + if (p->dl.dl_non_contending || p->dl.dl_throttled) { >>> + /* >>> + * Inactive timer is armed (or callback is running, but >>> + * waiting for us to release rq locks). In any case, when it >>> + * will file (or continue), it will see running_bw of this >> >> s/file/fire ? > > Yep. > >>> + * task migrated to later_rq (and correctly handle it). >> >> Is this because of dl_task_timer()->enqueue_task_dl()->task_contending() >> setting dl_se->dl_non_contending = 0 ? > > No, this is related to inactive_task_timer() callback. Since the task is > migrated (by this function calling set_task_cpu()) because a CPU hotplug > operation happened, we need to reflect this w.r.t. running_bw, or > inactive_task_timer() might sub from the new CPU and cause running_bw to > underflow. I was more referring to the '... it will see running_bw of thus task migrated to later_rq ...) and specifically to the HOW the timer callback can detect this. I should have made this clearer. inactive_task_timer() checks if (dl_se->dl_non_contending == 0) so I thought I have to find the place where dl_se->dl_non_contending is set 0?