Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp339890ima; Fri, 15 Mar 2019 04:07:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx70LwnJ2eyxxK9JGI0U40iWs1TeCMcf+wH9KoCAlUrLVJKZHTihryt9ag4K7+I3meosJ85 X-Received: by 2002:a63:fb0b:: with SMTP id o11mr2822504pgh.222.1552648073681; Fri, 15 Mar 2019 04:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552648073; cv=none; d=google.com; s=arc-20160816; b=oINkKxM0g8/dU1kG/x81ieg0+TttFg3U+RQPr0ytlYeLa1t7lZfSaJmIE3BYjZfJQX nDBWNcBdekGGOLnHCMUKJq63KonRVxA99A40quvKcMTTVgkpkLMBZMaV+kNgRnMYAqld gUbFLJwzWzuuG9T2/X8olfY9ueYpuHx2V13+K/CYoyLHqrgB5fkU1GQ+f7w01mzvGtRc 6XOAfMoeVM+aW8kzkrgZYpsFwoHVE6/69f2QC3jzk7Pr4i9n+5NsamG909+kHMzWDHuu GL8h3dvSlfbbhOd/hy8NvC3L897MOXEMvy6Dnq2hv5mh8w1Q6CgMth9wk1p/kHHW1wAk DVbA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=FZs8W3p1YHb22g/oGF4PZhAQb02x3i7S8fn40MED6GE=; b=pzullGklKs1GzVnifZnvbA8AAbbmpyilWJm45s82N2+7ZWxOkIx+HcUs6wC6lrsOCq 8cerujlj7+2szdZXzhrwL/F3a7apYDcN8QunlRuorYTD6Z3HHz9/meL6bAOapBrjPRjY QrFqpxWielbQJD8g4+GrKHlki2ZKoMDk2bhlaaCJsqCEwx0FV8zdD59EeVj1ct1ATChq BY9yBzvwXBfMhPl+iX7ehNxcwhfnvnZJ8TNfE5rAxteOrUnjjfVx4uGX1pEDrM3BTfcE /CIagizyZedC9y6HMMt2k/xI0cLgGEWNc/lQQXamGAt+4Y/jbMacFXraZZKHR9WRNTO+ Q7DQ== 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 m8si1499034pgp.322.2019.03.15.04.07.38; Fri, 15 Mar 2019 04:07:53 -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 S1729025AbfCOLGw (ORCPT + 99 others); Fri, 15 Mar 2019 07:06:52 -0400 Received: from mail.santannapisa.it ([193.205.80.98]:41271 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbfCOLGv (ORCPT ); Fri, 15 Mar 2019 07:06:51 -0400 Received: from [10.30.3.190] (account l.abeni@santannapisa.it HELO luca64) by santannapisa.it (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 137311565; Fri, 15 Mar 2019 12:06:48 +0100 Date: Fri, 15 Mar 2019 12:06:43 +0100 From: luca abeni To: "chengjian (D)" Cc: "linux-kernel@vger.kernel.org" , Li Bin , "Xiexiuqi (Xie XiuQi)" , , Peter Zijlstra , Juri Lelli Subject: Re: WARN ON at kernel/sched/deadline.c task_non_contending Message-ID: <20190315120643.3fe3afb5@luca64> In-Reply-To: <0032cd53-05b4-002a-6860-62b51e9e8299@huawei.com> References: <20190313154948.773427d6@luca64> <0032cd53-05b4-002a-6860-62b51e9e8299@huawei.com> Organization: Scuola Superiore S. Anna X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 15 Mar 2019 08:43:00 +0800 "chengjian (D)" wrote: [...] > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > > index 6a73e41a2016..43901fa3f269 100644 > > --- a/kernel/sched/deadline.c > > +++ b/kernel/sched/deadline.c > > @@ -252,7 +252,6 @@ static void task_non_contending(struct > > task_struct *p) if (dl_entity_is_special(dl_se)) > > return; > > > > - WARN_ON(hrtimer_active(&dl_se->inactive_timer)); > > WARN_ON(dl_se->dl_non_contending); > > > > zerolag_time = dl_se->deadline - > > @@ -269,7 +268,7 @@ static void task_non_contending(struct > > task_struct *p) > > * If the "0-lag time" already passed, decrease the active > > * utilization now, instead of starting a timer > > */ > > - if (zerolag_time < 0) { > > + if ((zerolag_time < 0) || > > hrtimer_active(&dl_se->inactive_timer)) { if (dl_task(p)) > > sub_running_bw(dl_se, dl_rq); > > if (!dl_task(p) || p->state == TASK_DEAD) { > > > > > > The idea is that if the timer is active, we leave dl_non_contending > > set to 0 (so that the timer handler does nothing), and we > > immediately decrease the running bw. > > I think this is OK, because this situation can happen only if the > > task blocks, wakes up while the timer handler is running, and then > > immediately blocks again - while the timer handler is still > > running. So, the "zero lag time" cannot be too much in the future. > > > > > > Thanks, > > Luca > > > > . > > > Yeah, it looks good. > > I can do some experiments with it , > > Do you have some testcases to help me with the test ? I just tried the test you provided... I also have some other SCHED_DEADLINE tests at https://github.com/lucabe72/ReclaimingTests but I did not try them with this patch yet. Claudio Scordino also had some SCHED_DEADLINE tests here: https://github.com/evidence/test-sched-dl Luca