Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1955809ybh; Fri, 24 Jul 2020 00:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVmar8QxCqOgFXr80ss/hc16vpQ+jKPX8u6oy/JibNhmGrOZvZ7RfVqJ/a+HtHp+vQJGml X-Received: by 2002:a05:6402:947:: with SMTP id h7mr7787662edz.213.1595574943004; Fri, 24 Jul 2020 00:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595574942; cv=none; d=google.com; s=arc-20160816; b=jzdi8GP8/mdb0S+Ce0lN22WE/XSFbJfpLfxdtZuZBfakL9hxZFnkwvy/qySBZtk8ro Qmj5MbzQRbOoOBNZK8dDB03yj/cL1wqcehXnSdjorNRWb/+/RZ0X8Ac4fVYZuzp2AXc8 fE3Y7DdWsm6u2BG9eYlhJmpymvWBo3XqG80czzjQir8Z+SbragsXkPIDCygksaM5EI75 u9Z/lVv0rO7Et1A9Dl/s1jB2MnX8SsiygoRCMW8+/5TzJAL5qyBgZmV2ZEMOnENbnmIt +xzbMnDlTc3IeRN2xgFaBito3816t877nh4O8abuUNacsieZEtQC7Vn9nmITJKfxhNmw oLiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/5K07WFbnYzpw23Eyz/mfTqQbQ4feMmgm06DmRfK4gw=; b=G2STSAI8/ZD8VMNveEdm53jYzT6KZOLumySe8E+KNecH8vI5jgAUvuHqmxBosUUHwO RzCJXWlgM+UKjwKYpvt539iBO4VMrCmAsharsZvqqf4yOkH00sxl4QaZ+VG0hQvxZv2t mr/U2jTQlJtbHTzflk39M3mY5sqq9+Y7OvPFBVMA4s9vqAY0AbVPcwtzTJICb0NxgGMo /WXfOLwwMJlNExXBPYpBl+q288j5x0iWDNBZYw31SusJfm98TItaPszAezI9R5BdUVpS gqybAUVZVOulFwazlVjVWpHAstq5flVca4kKSWcGKtz4xs3P9lvvqD1929gAgF4sAB9O gArw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G7YuvgTi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si6761edx.581.2020.07.24.00.15.21; Fri, 24 Jul 2020 00:15:42 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G7YuvgTi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbgGXHOf (ORCPT + 99 others); Fri, 24 Jul 2020 03:14:35 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46294 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726543AbgGXHOe (ORCPT ); Fri, 24 Jul 2020 03:14:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595574873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/5K07WFbnYzpw23Eyz/mfTqQbQ4feMmgm06DmRfK4gw=; b=G7YuvgTihJLznHzZ5EQaUb9gI9nZPc7pRVAoseO9F0FHsZT4inYtn0UVQTvxDqh15weJ2T fUA/9ImAPfAmnMztY0rASZOp0Ib0HQi43cVYWnyizFBbOUKTGfGUz+S1NMEevB79Ox/co7 ZWBkjEI5fhOn8dTSnj/QIoIfolqnEAk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-Yn_UAiYjOcOEgoBr_whdEQ-1; Fri, 24 Jul 2020 03:14:31 -0400 X-MC-Unique: Yn_UAiYjOcOEgoBr_whdEQ-1 Received: by mail-wm1-f69.google.com with SMTP id v8so2930242wma.6 for ; Fri, 24 Jul 2020 00:14:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/5K07WFbnYzpw23Eyz/mfTqQbQ4feMmgm06DmRfK4gw=; b=jXp5J+Cv7jhCXrC0cxx9JG41JMjcU+EA48Rx3NrvCAuZCD1MGZ4dBnIZOqEnuC+3YA K/iNH8q1rwIBhZmWoinrAKe0/zbmP7fpvhocIevIJb9H5zaMnnMzOS5vOYs9OdhCdTnO ZxqjHscnY8c4EyFVM04fRppRlYl14nmxqLTWhmsBqgUazUl+og+1gN9T49cUMUAYkZki OG8Sm4+pakdgN8QCMXI5EcW8Ji6kFjN/fBJh6fzltjvIEhiB7TtnQ3AZI+c5zs19Q8Vj mb99Dr2nmYsW+Yj+rgbQwACdaPllPogGQBNcYf+3owQVspJzl08uzIWOwIQiDZusiOma 1Rvg== X-Gm-Message-State: AOAM530B6qmWkudfT7QaJRdhUBAoC3pkRzVw73zDBNoULVWfzQwHlC83 X5n0M/gP07ugN1Whd+PdWimhmRytSGYuoVUPovvKSHGscbf6taZS7TYdCdUT6dBlJHb2Y9id4cJ dT6fy5yOGZi2MjBQYOCC5y8Fs X-Received: by 2002:a1c:988a:: with SMTP id a132mr7196230wme.14.1595574870050; Fri, 24 Jul 2020 00:14:30 -0700 (PDT) X-Received: by 2002:a1c:988a:: with SMTP id a132mr7196208wme.14.1595574869790; Fri, 24 Jul 2020 00:14:29 -0700 (PDT) Received: from localhost.localdomain ([151.29.94.4]) by smtp.gmail.com with ESMTPSA id e5sm221437wrc.37.2020.07.24.00.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 00:14:28 -0700 (PDT) Date: Fri, 24 Jul 2020 09:14:26 +0200 From: Juri Lelli To: Peng Liu Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, Daniel Bristot de Oliveira Subject: Re: [PATCH] sched/deadline: dome some cleanup for push_dl_task() Message-ID: <20200724071426.GD14912@localhost.localdomain> References: <20200706160442.GA19741@iZj6chx1xj0e0buvshuecpZ> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706160442.GA19741@iZj6chx1xj0e0buvshuecpZ> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". Thanks, Juri