From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1320CC433EF for ; Thu, 17 Feb 2022 12:57:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FCC86B0075; Thu, 17 Feb 2022 07:57:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AB196B0078; Thu, 17 Feb 2022 07:57:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79ABC6B007B; Thu, 17 Feb 2022 07:57:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 6E16E6B0075 for ; Thu, 17 Feb 2022 07:57:36 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2AC9518128AF7 for ; Thu, 17 Feb 2022 12:57:36 +0000 (UTC) X-FDA: 79152273312.16.E2F4806 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id AF7A14000B for ; Thu, 17 Feb 2022 12:57:35 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8C1861B03; Thu, 17 Feb 2022 12:57:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE58DC340E8; Thu, 17 Feb 2022 12:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645102654; bh=kgjS5WxgVrvPzinoXteH3mXgOP0TCfzBtzDNqiGy1Eg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TvrdZQFBn72v6oLTS1g5ytXiKTh95tIKNQZlXZ2P10HtrbAc2lpx/rdcUUe1xbkNG ukX1M8e6U3zK1Fsdv7439Y6HsyLUjag80AEhMaYaw2ZnjmCIdT8h52X6FI5FN8d/A3 gCYELIsnagHOkwsj5gE/6YFBVvg3FS0ppr1WZ8k43gXNJKfux+jVpsPY47aYEY3MlJ TMbrY+F3GrrQKuHh/0T/Z8jCEd/wxAexZSbPMvB7lMxS+tmZz0LUYRREvfthWT8pkh LNiuTNT5M963ntdoV11HXHABnQZiiuJbuo+BPaNMn5SQBRVdUYLaFhTQkRJMfeo2q8 lZCE8Ss+H1UMw== Date: Thu, 17 Feb 2022 13:57:31 +0100 From: Frederic Weisbecker To: Aaron Tomlin Cc: Phil Auld , tglx@linutronix.de, mingo@kernel.org, mingo@redhat.com, atomlin@atomlin.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH] tick/sched: Ensure quiet_vmstat() is called when the idle tick was stopped too Message-ID: <20220217125731.GA744754@lothringen> References: <20220203214339.1889971-1-atomlin@redhat.com> <20220216143412.dwxjlkq4w2zeweld@ava.usersys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220216143412.dwxjlkq4w2zeweld@ava.usersys.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: AF7A14000B X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TvrdZQFB; spf=pass (imf27.hostedemail.com: domain of frederic@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=frederic@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: kw9xipsut8apt7mesnu8xyn7tz6qg1ey X-HE-Tag: 1645102655-897542 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Feb 16, 2022 at 02:34:12PM +0000, Aaron Tomlin wrote: > On Thu 2022-02-03 17:22 -0500, Phil Auld wrote: > > As I said earlier, I don't think you want to call quiet_vmstat() > > unconditionally. And I don't think this will catch the cases you are > > trying to fix. Once the tick is stopped tick_nohz_stop_tick should not be > > getting called again until it's been restarted. > > Phil, > > Sorry about the delay. If I understand correctly, I see a scenario by which > tick_nohz_stop_tick() can be called on transition/or exit from idle (e.g. > default_idle_call()): > > 1. The idle/or scheduling-clock was previously > stopped > > 2. It is considered safe for the scheduling-clock > tick to remain "stopped"/or omitted; no need to > reprogram and enable a periodic tick > (e.g. no queued/or expired pending timer) > > ... > do_idle > cpuidle_idle_call > { > > ... > > .-- default_idle_call > | arch_cpu_idle > | goto exit_idle > | > | exit_idle: > | __current_set_polling() > | > | } > | tick_nohz_idle_exit() > | { > | > | tick_stopped = ts->tick_stopped > | > | if (tick_stopped) > | tick_nohz_idle_update_tick(ts, now) > | if (tick_nohz_full_cpu(smp_processor_id())) > | __tick_nohz_full_update_tick(ts, now) > | { > | int cpu = smp_processor_id() > | > | if (can_stop_full_tick(cpu, ts)) > | tick_nohz_stop_sched_tick(ts, cpu) > | if (tick_nohz_next_event(ts, cpu)) > '-- tick_nohz_stop_tick(ts, cpu) > } > } > > If I understand correctly, __tick_nohz_full_update_tick() can return with > no changes to the current tick (e.g. expire time == KTIME_MAX), no? Hmm, but does it matter? The issue seem to be that we can enter in idle loop without flushing vmstat. Or am I missing something else? Thanks. > > > Kind regards, > > -- > Aaron Tomlin >