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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD818C2D0E4 for ; Fri, 20 Nov 2020 18:04:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1CA9522470 for ; Fri, 20 Nov 2020 18:04:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CA9522470 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 89A5B6B0071; Fri, 20 Nov 2020 13:04:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84C066B0072; Fri, 20 Nov 2020 13:04:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 788BF6B0073; Fri, 20 Nov 2020 13:04:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 4C3926B0071 for ; Fri, 20 Nov 2020 13:04:37 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id ED48A8249980 for ; Fri, 20 Nov 2020 18:04:36 +0000 (UTC) X-FDA: 77505571752.11.kitty87_25076fa2734d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id C6F66180F8B82 for ; Fri, 20 Nov 2020 18:04:36 +0000 (UTC) X-HE-Tag: kitty87_25076fa2734d X-Filterd-Recvd-Size: 2327 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 18:04:36 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id D38423F529; Fri, 20 Nov 2020 18:04:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D190E3E9FD; Fri, 20 Nov 2020 18:04:35 +0000 (UTC) Date: Fri, 20 Nov 2020 18:04:35 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Matthew Wilcox cc: Marcelo Tosatti , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] mm: introduce sysctl file to flush per-cpu vmstat statistics In-Reply-To: <20201117190926.GU29991@casper.infradead.org> Message-ID: References: <20201117162805.GA274911@fuller.cnet> <20201117180356.GT29991@casper.infradead.org> <20201117190926.GU29991@casper.infradead.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Tue, 17 Nov 2020, Matthew Wilcox wrote: > > So what we would need would be something like a sysctl that puts the > > system into a quiet state by completing all workqueue items. Idle all > > subsystems that need it and put the cpu into NOHZ mode. > > Why does it need to be something userspace does? It would seem reasonable > that the kernel could figure out for itself that it's about to start > this CPU operating in isolated mode and flush all the work first? The kernel holds objects for various purposes in caches just in case. And these objects are expired when they are considered cache cold. Similarly vmstat does not fold counters into the global ones just in case more things need to be locally counted in order to prevent contention on the global counters. The kernel cannot know that user space will not be using system calls but wants a quiet operating environment without interruptions for cache expiration and other things. The kernel can do all sorts of preventitive work to avoid deferred actions and create a OS noise free environment for the application.