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 E4053C433F5 for ; Wed, 16 Feb 2022 21:21:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 267716B0074; Wed, 16 Feb 2022 16:21:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 215EA6B0075; Wed, 16 Feb 2022 16:21:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1055C6B0078; Wed, 16 Feb 2022 16:21:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 0065F6B0074 for ; Wed, 16 Feb 2022 16:21:10 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9E2E795C8A for ; Wed, 16 Feb 2022 21:21:10 +0000 (UTC) X-FDA: 79149913500.10.53F8E76 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 017D4C0003 for ; Wed, 16 Feb 2022 21:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645046469; 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=mzmlA9wGPTOGQ6ABHOLo+JGoedgg2opfplTiy2DMtgE=; b=VYYNECPpHhsoALskxGDxkYGfh02tgxpaNHoEsrOXPngn0j5OSnxVX09BsyH+Xq18B6Avjl WXOMUB7fAllyrSMWkmasV2PB5gCHiLytJmBK5PC50TyMDFMvyhz9N1Qtf4uB+u4jQIJIYX 3O49yvDYS1LBB60J+vbGYKyrivaYwzE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-gxKz_9w3PZSnUWgzo8tjRw-1; Wed, 16 Feb 2022 16:21:04 -0500 X-MC-Unique: gxKz_9w3PZSnUWgzo8tjRw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBA631091DA2; Wed, 16 Feb 2022 21:21:02 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.22.32.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50BE36ABA2; Wed, 16 Feb 2022 21:20:43 +0000 (UTC) Date: Wed, 16 Feb 2022 16:20:41 -0500 From: Phil Auld To: Aaron Tomlin Cc: frederic@kernel.org, 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: 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Stat-Signature: 34zgbq1nz4j5x4b88w7197amdnh947fk X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 017D4C0003 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VYYNECPp; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf28.hostedemail.com: domain of pauld@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=pauld@redhat.com X-Rspam-User: X-HE-Tag: 1645046469-28425 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()): No worries. It's possible that I am misunderstanding the issue still... :) > > 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? > Yeah, I missed that path, so tick_nohz_stop_tick() can get called with the tick already stopped. My concern was about calling quiet_vmstat() if the tick was not stopped as per the comment on that function. But looking more closely at tick_nohz_stop_tick() it won't be doing that with your patch. If this is fixing the issue you are seeing (I don't remember if you had a reproducible case or not) then I think this could be a good way to do it. It does seem to rely on a few things lining up right to get to the call to tick_nohz_stop_tick(). Cheers, Phil > > Kind regards, > > -- > Aaron Tomlin > --