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 EBCE0C5479D for ; Sat, 7 Jan 2023 00:15:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35C7B8E0002; Fri, 6 Jan 2023 19:15:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30C908E0001; Fri, 6 Jan 2023 19:15:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FBB28E0002; Fri, 6 Jan 2023 19:15:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0DDB28E0001 for ; Fri, 6 Jan 2023 19:15:47 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BF3E51A07C3 for ; Sat, 7 Jan 2023 00:15:46 +0000 (UTC) X-FDA: 80326084692.09.F42C3F8 Received: from mail3-163.sinamail.sina.com.cn (mail3-163.sinamail.sina.com.cn [202.108.3.163]) by imf06.hostedemail.com (Postfix) with ESMTP id C727C18000C for ; Sat, 7 Jan 2023 00:15:43 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.163 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673050545; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OJX2LR4r58x56W+/od/OyuiCunee4sf1rqy7jzRZSgU=; b=msGaKKeOPa+6ULYR9qENOMk5pMRuCBAUBWE+vol/obDmDVP2TdFBAmR1d07Qu4diOYaX+u rGjnAskz4MSd0inF2RpC3QaZBVgf/sj2pjr2/uj/6a0nw0c4JCkVU10CuAvxB8l5rRq0XK aACghYQaUJ8aHPFbK/dVo8PSI15wYvE= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.163 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673050545; a=rsa-sha256; cv=none; b=WZgjCn3XCKFP99cp0DmBK7kLaJW+iOcYmIcrb2p5xBG02/JePdSYk91/K/HklHJGIjp5GR viPXQWLtNi8fx1T5oj8DwaTccE3oj5AYRvKwyJFhEMrGFzzLQQ7YjIabehzuy96Y6SYlzG 0kLzmFqCSQaBcsrXll1minqWFIh2EDM= Received: from unknown (HELO localhost.localdomain)([114.249.57.238]) by sina.com (172.16.97.27) with ESMTP id 63B8B94900033354; Sat, 7 Jan 2023 08:14:03 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 15591949284037 From: Hillf Danton To: Marcelo Tosatti Cc: atomlin@atomlin.com, frederic@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v13 3/6] mm/vmstat: manage per-CPU stats from CPU context when NOHZ full Date: Sat, 7 Jan 2023 08:15:29 +0800 Message-Id: <20230107001529.4617-1-hdanton@sina.com> In-Reply-To: References: <20230105125218.031928326@redhat.com> <20230106001244.4463-1-hdanton@sina.com> <20230106150154.4560-1-hdanton@sina.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: p4fmbh4r8gf44nb3dkod6nycr8kpysp1 X-Rspam-User: X-Rspamd-Queue-Id: C727C18000C X-Rspamd-Server: rspam06 X-HE-Tag: 1673050543-782414 X-HE-Meta: U2FsdGVkX1/SIYZGgHKJh2rFPsb7s0ddHbBzaPq0VCa0jgxx9/MT3inCGo6dcnShGIQyFv4TFgwZoGMqpKgCUi3kfcRpq9HC5h7ySgCuJMiHukQ4pOTup0gCuAqkzhIK4AmramJL2E1SndGncb7svunGL6ywHO/sYUtoRvLmtiOjWYnYbdUnO771V5UD+LKMZ0HU3xWYiztJi3y/EkHNMnz5BTKxmgFBU2P4BPxuCNGPDOL4s85uQYKeXafCH0I0eWAUHxVX5TVA977Mm35hs0NJlRlB8TnmL9GsiYM/Lf7HhHEVlh1sIIiWZblnx3EYQ9n1CkZDbcPAw0iXDrauLh3oUkq6YAhFvPgg83tB0jgpYoGwYR75a/qgIjXjC1Juco+e98wdW5fMQ6uAUsm5LB+KtjfSxrXfcclGwJcC93ubr2XVpsl4iRFBEu89WuFJga/TZiaUQQnXDw3DiOOqCX3Ex8r3h1j9VUvhKd5PklamNvFGCsr82gUgkCPWVRNCJDrIMecmQ2HSJwKOxaNd1YrwA3ki3wGWYZl/Jv9zi3M0z/JDgxleFaAILTj4fp4gFYWivZQCSX0EUgsVSDMoaTb9YqWZVZTX+peGvBpxT3ZLkgk30rmawcvlz2ge+dAF9c3/c06+57Gocc+OVdk4pn8xW3s9Cj9VKYCHV1Ieb7T8C0KXV/8Tscx6VVf3/vKhLDIwsJPbu5ULdUeCO5s/03Q+DGA+VTlbBherWLlCaTRDoV68J8OFUZLM9jB/lM5Qz6Bn7ParFiVIQAkOn4UAQodQkYGyVbcJ6xJ8SUP/hYw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.007309, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 6 Jan 2023 15:16:23 -0300 Marcelo Tosatti > On Fri, Jan 06, 2023 at 11:01:54PM +0800, Hillf Danton wrote: > > On 6 Jan 2023 09:51:00 -0300 Marcelo Tosatti > > > On Fri, Jan 06, 2023 at 08:12:44AM +0800, Hillf Danton wrote: > > > > > > > > Regression wrt V12 if timer is added on the CPU that is not doing HK_TYPE_TIMER? > > > > > > Before this change, the timer was managed (and queued on an isolated > > > CPU) by vmstat_shepherd. Now it is managed (and queued) by the local > > > CPU, so there is no regression. > > > > Given vm stats folded when returning to userspace, queuing the delayed work > > barely makes sense in the first place. If it can be canceled, queuing it burns > > cycles with nothing earned. Otherwise vm stats got folded already. > > Agree, but you can't know whether return to userspace will occur > before the timer is fired. No way to predict a random timer expiration, no? > > So queueing the timer is to _ensure_ that eventually vmstats will be > synced (which maintains the current timing behaviour wrt vmstat syncs). After this change, > > > > > @@ -1988,13 +2022,19 @@ void quiet_vmstat(void) > > > > > if (!is_vmstat_dirty()) > > > > > return; > > > > > it is only ensured eventually by this check instead. > > > > > + refresh_cpu_vm_stats(false); > > > > > + > > > > > + if (!IS_ENABLED(CONFIG_FLUSH_WORK_ON_RESUME_USER)) > > > > > + return; > > > > > + > > > > > + if (!user) > > > > > + return; > Also don't think the queueing cost is significant: it only happens > for the first vmstat dirty item. Cost is considered only if it is needed. > > > Nor does shepherd even without delay. And the right thing is only make shepherd > > leave isolated CPUs intact.