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 F3B00C433EF for ; Fri, 18 Feb 2022 12:55:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D6B66B0074; Fri, 18 Feb 2022 07:55:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 482566B0075; Fri, 18 Feb 2022 07:55:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 323536B0078; Fri, 18 Feb 2022 07:55:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 20DB96B0074 for ; Fri, 18 Feb 2022 07:55:01 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D2F7594FB4 for ; Fri, 18 Feb 2022 12:55:00 +0000 (UTC) X-FDA: 79155895560.21.32E0A8A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 372CAC0008 for ; Fri, 18 Feb 2022 12:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645188899; 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=88nBv9CM5sW4ELGVD1fgBUk+sSiPdeBM/3xxb6Xhxvg=; b=ZRXIydv8OCZimQhVRlQ02s+0jlqnLAKcoU+LxNXt8zDy2ixHvM8ZFZy7zudTSLkyceqize FCvkb0xMPKdzsivY7mkjgLDkIlXjd+KYcCsDZQYgpiUSy96bL4c8P6wPzX03r/AG3nSi3L NpJJMyq3XXMGvFmVzyxYkXDNElGUOXw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-153-wuGpVVEaO3ilchgrwdWh2w-1; Fri, 18 Feb 2022 07:54:58 -0500 X-MC-Unique: wuGpVVEaO3ilchgrwdWh2w-1 Received: by mail-wm1-f72.google.com with SMTP id i188-20020a1c3bc5000000b0037bb9f6feeeso5891905wma.5 for ; Fri, 18 Feb 2022 04:54:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=88nBv9CM5sW4ELGVD1fgBUk+sSiPdeBM/3xxb6Xhxvg=; b=x/KULUENG6Ol/Dy3k6U10zpftU4Q8Q++tviFzo08factww5kjfNgC7B7OyS7YrHW4D NSFLTNtJv0eF+bTz5mBkY7q0XDVwOjz1XmI9jrBuSifnKPFwJaMR/fW56mM+0O0V/bnc rnOcIpYCzz4P6JWy5c82x7XqzNrhf/fLZuBrh8+loZ13N23gDpl33ZS9L1jcww0meRvp xskzbZ3KMtEsFj02CcVbsNZcN1xQbNf2ortuLWPC1wxon4cqojnaT17k2DYWGcVrpGAt UUlsEL3iMrkN8gD15ackRCpvMtLsVV0hSRtGn2Px8bDYghCRD8eZVgIGj6L/Jt+gIngX 2P8g== X-Gm-Message-State: AOAM533czMgmul3I29LZm+0/Q0L2hrYmWkM4OdbCxL8KEUG6StQiIWua pFhn+aQpou8zoQKs/YLq75jpcP+7ZT83gm9+3tQ1uL5lBJb8hF3NW7LCksofNvuaTouWy8fCUvs nESW0valU7w== X-Received: by 2002:a7b:ce90:0:b0:37d:1e50:1b60 with SMTP id q16-20020a7bce90000000b0037d1e501b60mr10447192wmj.185.1645188897182; Fri, 18 Feb 2022 04:54:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNQX5GfcDKh9eOaiz+k0HYtIt1SQne0UO0m6TJ2xtgaBH5ARpEgHOHXEcjA/E1em14nrjSqA== X-Received: by 2002:a7b:ce90:0:b0:37d:1e50:1b60 with SMTP id q16-20020a7bce90000000b0037d1e501b60mr10447170wmj.185.1645188896948; Fri, 18 Feb 2022 04:54:56 -0800 (PST) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id t4sm4168545wmj.10.2022.02.18.04.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:54:56 -0800 (PST) Date: Fri, 18 Feb 2022 12:54:54 +0000 From: Aaron Tomlin To: Frederic Weisbecker Cc: Aaron Tomlin , Marcelo Tosatti , 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: <20220218125454.utlgmuhijklzr3if@ava.usersys.com> X-PGP-Key: http://pgp.mit.edu/pks/lookup?search=atomlin%40redhat.com X-PGP-Fingerprint: 7906 84EB FA8A 9638 8D1E 6E9B E2DE 9658 19CC 77D6 References: <20220203214339.1889971-1-atomlin@redhat.com> <20220217124729.GA743618@lothringen> <20220217142615.xqtiydixvnumyvei@ava.usersys.com> <20220217163205.GA748087@lothringen> MIME-Version: 1.0 In-Reply-To: <20220217163205.GA748087@lothringen> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZRXIydv8; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf22.hostedemail.com: domain of atomlin@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=atomlin@redhat.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 372CAC0008 X-Stat-Signature: cks597nrqzppdx38ejxzbytur879qbi8 X-HE-Tag: 1645188900-546675 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 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? 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... If I understand correctly, I agree. For the latter case, nothing can be done unfortunately since the scheduling-clock tick is stopped. Kind regards, -- Aaron Tomlin