Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1518974pxm; Thu, 24 Feb 2022 04:56:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTjshT7Ljq5ajvno3XcyrwSxHuTLcMZPkKtO91jhE14tbRZIm5p4+YLdPgLXHIbjTrnLLM X-Received: by 2002:a63:e4e:0:b0:372:f055:5e12 with SMTP id 14-20020a630e4e000000b00372f0555e12mr2192702pgo.485.1645707397856; Thu, 24 Feb 2022 04:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645707397; cv=none; d=google.com; s=arc-20160816; b=wpiw0tZzCwnKcBnPg86T6DMrBdsNcwlNKddC69RH3WYra17TJxcC1c3H8dA2LhClMk T2f1iH+vK0ODD/hdSPbyJoH3BqLvTtSUvlxS8ha7NxwVcoRp09LTFqatGkoWgMzABA54 5M4w4lteZeH6zK0Z9Hs4a0fdzvzDymMCg9w5hGpx2SR60EZJeNv6SWZfQv1GfTEHVBB0 ggXX9LsvC6/YIaTghzOHqWnb8ovG5tkBx000lUwBpONglO2wrL+rcpb/pAle5cChNykJ 2AseAhZwJpegjgqm/VJ4oUWli9UCbOD4nqAaxNIWT3P0tpm0WuW//AM+euNuq7T8kXG1 3NEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AqOiTimbhwMR6JdlyxUT8Se6t3oyzrlLLdGUoWlPRkk=; b=sg9OFgsQh9VfvJBnkuj2z1A69x9MmRXjtjsk/vf3XeRrdYqPTmhH2RA98IYUyNcZx5 wQObRis6oa7ydq6wFxxF2Y0egZtDPBLvuOuqWLLP36VOM/85IxKCv+nHa4xupy0VQbYA kmYkuf1xHT+B/4ONjCpfkl/aiDDtBzSimvQrAOV7lLDjUvnZ5gA4RfpF72uZaWSryCuI FpdS6iUIkoZo3F1Dgq7bNujSoXgOAoCCn8PIR8/JFUNsVhG9quqa6JQTIRMhn++1ene9 yDqNaSvUm4SFfUAVcmwJLzo8zfirwf4XX8yjL381/w3DZRjp3EfcGz9EFnezbftcil5k yy+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XEjV0eML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be1si2699811pgb.61.2022.02.24.04.56.23; Thu, 24 Feb 2022 04:56:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XEjV0eML; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234309AbiBXMbI (ORCPT + 99 others); Thu, 24 Feb 2022 07:31:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231460AbiBXMbH (ORCPT ); Thu, 24 Feb 2022 07:31:07 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37CC3264987 for ; Thu, 24 Feb 2022 04:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645705837; 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=AqOiTimbhwMR6JdlyxUT8Se6t3oyzrlLLdGUoWlPRkk=; b=XEjV0eMLw9BRwrlhnYjKrHKMOeEGTlUNEPHN9O91WpebEY4/KXJk0HjytO9yUTd7oMCVFk IijxeH976fJuTB1w21xWW9m8Snt0pIi3hKbgoyH8VxU5hrNF9Cl1BTOYRrNVlRUqm4LSI6 22h+5oUh9C2Lv998SN1mIMHvN8G9vLI= 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-125-Px0M8utHMYCc6ouXz-mjKA-1; Thu, 24 Feb 2022 07:30:36 -0500 X-MC-Unique: Px0M8utHMYCc6ouXz-mjKA-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 AC89C1854E27; Thu, 24 Feb 2022 12:30:34 +0000 (UTC) Received: from fuller.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66F5B7BB6C; Thu, 24 Feb 2022 12:30:34 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 80720416D862; Thu, 24 Feb 2022 09:30:11 -0300 (-03) Date: Thu, 24 Feb 2022 09:30:11 -0300 From: Marcelo Tosatti To: Aaron Tomlin Cc: Frederic Weisbecker , Christoph Lameter , tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Phil Auld 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> <20220217124729.GA743618@lothringen> <20220217142615.xqtiydixvnumyvei@ava.usersys.com> <20220217163205.GA748087@lothringen> <20220218125454.utlgmuhijklzr3if@ava.usersys.com> <20220219154616.pwsvh445x3vn7ltf@ava.usersys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 24, 2022 at 09:27:14AM -0300, Marcelo Tosatti wrote: > On Sat, Feb 19, 2022 at 03:46:16PM +0000, Aaron Tomlin wrote: > > On Fri 2022-02-18 12:54 +0000, Aaron Tomlin wrote: > > > On Thu 2022-02-17 17:32 +0100, Frederic Weisbecker wrote: > > > > > If I understand correctly, in the context of nohz_full, since such work is > > > > > deferred, it will only be handled in a scenario when the periodic/or > > > > > scheduling-clock tick is enabled i.e. the timer was reprogrammed on exit > > > > > from idle. > > > > > > > > Oh I see, it's a deferrable delayed work... > > > > Then I can see two other issues: > > > > > > > > 1) Can an interrupt in idle modify the vmstat and thus trigger the need to > > > > flush it? > > Yes. Page allocation and page freeing for example. > > 6 3730 ../mm/page_alloc.c <> > __mod_zone_freepage_state(zone, -(1 << order), > 4 1096 ../mm/page_alloc.c <<__free_one_page>> > __mod_zone_freepage_state(zone, -(1 << order), > > > > > I believe it's the case and then the problem goes beyond nohz_full > > > > because if the idle interrupt fired while the tick is stopped and didn't set > > > > TIF_RESCHED, we go back to sleep without calling quiet_vmstat(). > > > > > > Yes: e.g. a nohz_full CPU, in idle code, could indeed receive a reschedule > > > IPI; re-enable local IRQs and generic idle code sees the TIF_NEED_RESCHED > > > flag against the idle task. Additionally, the selected task could > > > indirectly released a few pages [to satisfy a low-memory condition] and > > > modify CPU-specific vmstat data i.e. vm_stat_diff[NR_FREE_PAGES]. > > > > > > > > > > 2) What if we are running task A in kernel mode while the tick is stopped > > > > (nohz_full). Task A modifies the vmstat and goes to userspace for a long > > > > while. > > > > Your patch fixes case 1) but not case 2). The problem is that TIMER_DEFERRABLE > > > > should really be about dynticks-idle only and not dynticks-full. I've always > > > > been afraid about enforcing that rule though because that would break old > > > > noise-free setups. But perhaps I should... Can't grasp the sentence above "The problem is that ...". What rule?