Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2263825imm; Mon, 28 May 2018 05:02:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIdGwf2pnl90J3vE+k3WAwuXC4PmR+N6ryXHYoQz4s6ELLWxgJLZcLTxu+F8BS7XSKrw6Qr X-Received: by 2002:a65:4c87:: with SMTP id m7-v6mr2731953pgt.364.1527508965395; Mon, 28 May 2018 05:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527508965; cv=none; d=google.com; s=arc-20160816; b=cCNRtfooQUMgEnD5R9u4tv+VnK4mlD2MGtzJGMjAGxWwEZmf7e2rlyHNTMFwzZbYug teC0SzNCa8ItmiPSHDz/0pGLhR0GSzon3TeIYhAdF/kAZXpClAgjodnBL9xPeAkexiNe VrJU2kDbE5FpbU8l7yyAtWaIma1BT5VrgIFwsNIvKHlPWEX4J4+UV2TM5b4kxEoJJ2gH 6ttxanvAa+Vgi0sm7N6Hp+fA8eASxrWIgNKZwXJRzkv9Y57DxmQxSxI47fgs2uvE1kpY uSo5R4dGfxqeGX7d/H1XUvoIOzPaeyN73C4FkpXXaR2J7oDaA8vOTFZVKPVErWbUOAfc IHVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=aLcnnYal/gUOjUfHb47optN05/8PD374mJvPV4HjXRg=; b=MYmgk0YZpX5h6DVSfCjcI2+NGk0LpDshZ3e/02wGrKd3Z/QFovrvQxbgYuyY1V090X AI9vZcE6Ga0pFNzkgnHd5IP6mRGNz9fvDuALN19KCWMpH+t0bav0leKGVprF83osE9V5 fqS1H4geTTGxpPYRQdy1h8oX73fDFpZhsCSRn5BU3SAhb3Cg+xkxoOIJMWLYwrdz+Dxe T4Cd0orTl8Y3ZQjn8uOrezJLQd74y+1lVCoePwByT76IxXPegjZjDAfpLKbhhckzoYtE en54A3wwwDn71lXHDRVJBlsqyvNPUMqSSlxvPgtc/4lCZxeX+Ch1zCxrx3d3g2ew7kRD Dq+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t7SRJiAh; 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 r1-v6si5346762pgu.52.2018.05.28.05.02.28; Mon, 28 May 2018 05:02:45 -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; dkim=pass header.i=@kernel.org header.s=default header.b=t7SRJiAh; 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 S938512AbeE1MAe (ORCPT + 99 others); Mon, 28 May 2018 08:00:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:54338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423432AbeE1LH3 (ORCPT ); Mon, 28 May 2018 07:07:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06E43208A5; Mon, 28 May 2018 11:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505648; bh=RcGe5sqjakEnzxunQvUdeymJb5EsfK73KkVU6YjHfVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t7SRJiAhE4m9lPFnVvfS2fHSohbUa+vHdNQHr+xxYnmFLjmnKPMYuqQznWtksL88L /xcNNT2vZdOWsg/F5U2to/tXSgKldQ6Hc8S0dYiZUXWH2HFlQF4JLzakyAwWGRv8/T OHt5B0ofM+bq+jf9rvmpKU66WQD71Wb8OUNAU7ks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davidlohr Bueso , Matt Fleming , "Peter Zijlstra (Intel)" , Linus Torvalds , Mike Galbraith , Thomas Gleixner , dave@stgolabs.net, rostedt@goodmis.org, Ingo Molnar , Sasha Levin Subject: [PATCH 4.16 077/272] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning Date: Mon, 28 May 2018 12:01:50 +0200 Message-Id: <20180528100247.467844356@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Davidlohr Bueso [ Upstream commit d29a20645d5e929aa7e8616f28e5d8e1c49263ec ] While running rt-tests' pi_stress program I got the following splat: rq->clock_update_flags < RQCF_ACT_SKIP WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 assert_clock_updated.isra.38.part.39+0x13/0x20 [...] enqueue_top_rt_rq+0xf4/0x150 ? cpufreq_dbs_governor_start+0x170/0x170 sched_rt_rq_enqueue+0x65/0x80 sched_rt_period_timer+0x156/0x360 ? sched_rt_rq_enqueue+0x80/0x80 __hrtimer_run_queues+0xfa/0x260 hrtimer_interrupt+0xcb/0x220 smp_apic_timer_interrupt+0x62/0x120 apic_timer_interrupt+0xf/0x20 [...] do_idle+0x183/0x1e0 cpu_startup_entry+0x5f/0x70 start_secondary+0x192/0x1d0 secondary_startup_64+0xa5/0xb0 We can get rid of it be the "traditional" means of adding an update_rq_clock() call after acquiring the rq->lock in do_sched_rt_period_timer(). The case for the RT task throttling (which this workload also hits) can be ignored in that the skip_update call is actually bogus and quite the contrary (the request bits are removed/reverted). By setting RQCF_UPDATED we really don't care if the skip is happening or not and will therefore make the assert_clock_updated() check happy. Signed-off-by: Davidlohr Bueso Reviewed-by: Matt Fleming Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Thomas Gleixner Cc: dave@stgolabs.net Cc: linux-kernel@vger.kernel.org Cc: rostedt@goodmis.org Link: http://lkml.kernel.org/r/20180402164954.16255-1-dave@stgolabs.net Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/sched/rt.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -843,6 +843,8 @@ static int do_sched_rt_period_timer(stru continue; raw_spin_lock(&rq->lock); + update_rq_clock(rq); + if (rt_rq->rt_time) { u64 runtime;