Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1607130pxb; Thu, 4 Mar 2021 16:11:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJybzp3KGyGPN757EG5MOXOzn2kSbPy4pnyIz9WDjDG3WHCp4Rm/RzxwqBv7d7cgxR8zS52f X-Received: by 2002:a92:c5cf:: with SMTP id s15mr6198134ilt.149.1614903069969; Thu, 04 Mar 2021 16:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614903069; cv=none; d=google.com; s=arc-20160816; b=EC7cRBv33kui2xNQaU3zUOZhrgIL2Pa7ftu4emFdnLsEs8gn8nnRP013rmqgkYEImv wqD9rV2DL8l48s5U3ljIj5lq6PKjp1xNCDcEck2EZY5vMOkZQvtbQeqJoZdH69/oXb52 pXsh4e9gNZFz5nn8fHGjLVG57xm/1zLDQHAVFuVf/EJkpzCCdlM4CEy4pmnWxPjhHyua uNCvvL7qbBWgU0WUyyZAI39n4XOHdphH1jxC3i9xZvxq3HYMstnqdBG5ZaaTTrS0sgR/ IdV0JHVq6Wl8xVrtdRs4ssXD2ly32RiE3T/99pWlDKHd2apZMWK6pvPCRp3jhs839mh2 akeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=/1FBYLtxhAxnw4SIQHK/VbbStNdAeZbr18aeA9ZUyzE=; b=OD7/ZfBe1AOk1oxP1hkiFpewwqy/hJgtPYiiSrTOXFLsLTksZZve+J1IncD51Mx2oL P+hllc0rnAoMOSoGGzpo+W+I6QLENIDg5QNoHcC6+hD60JE7hijLe7Zfv7MMUQ0uAeZD fQJ0+pubFXu4HqYrum5eecqqWZ3eiWG9vJrXSLraLe1xbiv0mlqV4T3FMAbtUqIBCRD2 cB2nCz2x0Wnj/9ctLLcAYDba3odNVwhjmmmOIUgLAs3LX3FEPf3tEx9d7VLhjAzoJVEq qP4jZ4U3hYN1MGEA0J3MgAFHsGWhq8mv0EjG2kb9Ylyq5gvgcoc4C5dTKJ0HBDBeSvnn kIWg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si896696jan.4.2021.03.04.16.10.56; Thu, 04 Mar 2021 16:11:09 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239645AbhCDL7p (ORCPT + 99 others); Thu, 4 Mar 2021 06:59:45 -0500 Received: from mga04.intel.com ([192.55.52.120]:8070 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239682AbhCDL7m (ORCPT ); Thu, 4 Mar 2021 06:59:42 -0500 IronPort-SDR: UrnLBjMoHGx5EbNWMihUGN2hLj93FjDOvntr84cW3U/qiN3i/HYG25519sTA9tXK9kKMw38tRz 7AW3zPoQyTaA== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="184989654" X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="184989654" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 03:59:01 -0800 IronPort-SDR: VblYH86PkOAJfSht4+uTOTPNr/R/oWUW0zBJP7aRvjGaRGXI1E+bPeE0sycFlrtFS0P+ykApj1 iVy14uplVX2w== X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="445704561" Received: from rjwysock-mobl1.ger.corp.intel.com (HELO [10.249.135.211]) ([10.249.135.211]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 03:58:56 -0800 Subject: Re: [PATCH tip/core/rcu 02/12] timer: Report ignored local enqueue in nohz mode To: paulmck@kernel.org, rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Frederic Weisbecker References: <20210304002225.GA23492@paulmck-ThinkPad-P72> <20210304002311.23655-2-paulmck@kernel.org> From: "Rafael J. Wysocki" Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk Message-ID: Date: Thu, 4 Mar 2021 12:58:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210304002311.23655-2-paulmck@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/4/2021 1:23 AM, paulmck@kernel.org wrote: > From: Frederic Weisbecker > > Enqueuing a local timer after the tick has been stopped will result in > the timer being ignored until the next random interrupt. > > Perform sanity checks to report these situations. > > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Rafael J. Wysocki > Signed-off-by: Frederic Weisbecker > Signed-off-by: Paul E. McKenney Reviewed-by: Rafael J. Wysocki > --- > kernel/sched/core.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index ca2bb62..4822371 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -674,6 +674,26 @@ int get_nohz_timer_target(void) > return cpu; > } > > +static void wake_idle_assert_possible(void) > +{ > +#ifdef CONFIG_SCHED_DEBUG > + /* Timers are re-evaluated after idle IRQs */ > + if (in_hardirq()) > + return; > + /* > + * Same as hardirqs, assuming they are executing > + * on IRQ tail. Ksoftirqd shouldn't reach here > + * as the timer base wouldn't be idle. And inline > + * softirq processing after a call to local_bh_enable() > + * within idle loop sound too fun to be considered here. > + */ > + if (in_serving_softirq()) > + return; > + > + WARN_ON_ONCE("Late timer enqueue may be ignored\n"); > +#endif > +} > + > /* > * When add_timer_on() enqueues a timer into the timer wheel of an > * idle CPU then this timer might expire before the next timer event > @@ -688,8 +708,10 @@ static void wake_up_idle_cpu(int cpu) > { > struct rq *rq = cpu_rq(cpu); > > - if (cpu == smp_processor_id()) > + if (cpu == smp_processor_id()) { > + wake_idle_assert_possible(); > return; > + } > > if (set_nr_and_not_polling(rq->idle)) > smp_send_reschedule(cpu);