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 87586C2BBCA for ; Tue, 25 Jun 2024 23:07:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 031D86B009A; Tue, 25 Jun 2024 19:07:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F22A86B009B; Tue, 25 Jun 2024 19:07:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E11146B009D; Tue, 25 Jun 2024 19:07:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C314B6B009A for ; Tue, 25 Jun 2024 19:07:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5C0D81606B0 for ; Tue, 25 Jun 2024 23:07:40 +0000 (UTC) X-FDA: 82270949880.19.E76D5E6 Received: from gentwo.org (gentwo.org [62.72.0.81]) by imf21.hostedemail.com (Postfix) with ESMTP id 87ECD1C0016 for ; Tue, 25 Jun 2024 23:07:38 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=linux.com (policy=none); spf=softfail (imf21.hostedemail.com: 62.72.0.81 is neither permitted nor denied by domain of cl@linux.com) smtp.mailfrom=cl@linux.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719356844; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXKjvfvwCK81ye9JDmcniyFgDF0O5934o+TJp1C1o3k=; b=hUJHe2XvbYXSGW4wOv6eN8K3BFuf1pId/iTDeh13Wqo3UkVdTn3g7daH1qRGqMun8l9hV8 Qkg2QiF9Voje/pbI9U2q8YCO2t7W2WUEuSAH+a/w008n73Aakdc+F5pu46CN4x2c4zEhYe g4Brv441XoivyZPgXAd+fuqJS6/A6P8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719356844; a=rsa-sha256; cv=none; b=fKxdukKR6aj1Sp1mg0sTlcePBJaqSx4q/VJcU/x1/kmHequZBXhVmJSaagfN4hce6QS9YI /xWV9cMvU/VSIViXUNo9GOOM6bkmxw5ePQnzxna1kNXMymsrCee95hE24kQ7gjx8sNhtkP hNQhX6JacSbMhpwJb+j5dznJd++7yfE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=linux.com (policy=none); spf=softfail (imf21.hostedemail.com: 62.72.0.81 is neither permitted nor denied by domain of cl@linux.com) smtp.mailfrom=cl@linux.com Received: by gentwo.org (Postfix, from userid 1003) id 38F8D4093E; Tue, 25 Jun 2024 15:35:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 37E0E4022C; Tue, 25 Jun 2024 15:35:21 -0700 (PDT) Date: Tue, 25 Jun 2024 15:35:21 -0700 (PDT) From: "Christoph Lameter (Ampere)" To: Yosry Ahmed cc: Shakeel Butt , Jesper Dangaard Brouer , tj@kernel.org, cgroups@vger.kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, longman@redhat.com, kernel-team@cloudflare.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] cgroup/rstat: Avoid thundering herd problem by kswapd across NUMA nodes In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 87ECD1C0016 X-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1Foxw BrtT/nbvEur9KAJxpwqYWirUSeC0e8wgmjlIjLi2o0qGn9epFOKoaWoMI3jevA57vRhT71N7hwt3FNjf0jWaMS6j6Og/SgXVO2mV35arZgN6G2K36+NKbXCv/lBK123JS9R4Yz58PU+HIIdyzon5mLnf2JblO930eC9pp/vTQU45ytwg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.082550, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, 25 Jun 2024, Yosry Ahmed wrote: >> In my reply above, I am not arguing to go back to the older >> stats_flush_ongoing situation. Rather I am discussing what should be the >> best eventual solution. From the vmstats infra, we can learn that >> frequent async flushes along with no sync flush, users are fine with the >> 'non-determinism'. Of course cgroup stats are different from vmstats >> i.e. are hierarchical but I think we can try out this approach and see >> if this works or not. > > If we do not do sync flushing, then the same problem that happened > with stats_flush_ongoing could occur again, right? Userspace could > read the stats after an event, and get a snapshot of the system before > that event. > > Perhaps this is fine for vmstats if it has always been like that (I > have no idea), or if no users make assumptions about this. But for > cgroup stats, we have use cases that rely on this behavior. vmstat updates are triggered initially as needed by the shepherd task and there is no requirement that this is triggered simultaenously. We could actually randomize the intervals in vmstat_update() a bit if this will help.