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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 11166C2D0E4 for ; Tue, 24 Nov 2020 18:29:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 661B820897 for ; Tue, 24 Nov 2020 18:29:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aZLpHBqK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 661B820897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C6E26B0070; Tue, 24 Nov 2020 13:29:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 675D76B0071; Tue, 24 Nov 2020 13:29:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58C006B0072; Tue, 24 Nov 2020 13:29:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id 41C566B0070 for ; Tue, 24 Nov 2020 13:29:42 -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 0B0671EE6 for ; Tue, 24 Nov 2020 18:29:42 +0000 (UTC) X-FDA: 77520150204.21.train59_500e47d27370 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id A2AF1180442C2 for ; Tue, 24 Nov 2020 18:29:41 +0000 (UTC) X-HE-Tag: train59_500e47d27370 X-Filterd-Recvd-Size: 4363 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 18:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606242579; 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=olCPX3JC98pdRkZ9NTBirztDyphi1UmeS/oHl2zYrOI=; b=aZLpHBqKwehwxJ/k7KH/EKzIlvpGAk8Tiofwel31gcLPcHRs7Hc7Bsr55posBzS4isXS96 s2FVjZSAlFYLjcty98L4PGXLaqWYPBs8h6I3i/YuY2HO+O0vDB3jBmHqrk8UyHj1oO7ovx YMY8zaMgRymPt1vp5TLGVu2QLIuobaw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-usx1BxfoNi6LTfgIbM99AQ-1; Tue, 24 Nov 2020 13:29:35 -0500 X-MC-Unique: usx1BxfoNi6LTfgIbM99AQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7091484A5E0; Tue, 24 Nov 2020 18:29:34 +0000 (UTC) Received: from fuller.cnet (ovpn-112-5.gru2.redhat.com [10.97.112.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C1015D71D; Tue, 24 Nov 2020 18:29:34 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 06663416D862; Mon, 23 Nov 2020 15:02:24 -0300 (-03) Date: Mon, 23 Nov 2020 15:02:23 -0300 From: Marcelo Tosatti To: Christopher Lameter Cc: Matthew Wilcox , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] mm: introduce sysctl file to flush per-cpu vmstat statistics Message-ID: <20201123180223.GA19269@fuller.cnet> References: <20201117162805.GA274911@fuller.cnet> <20201117180356.GT29991@casper.infradead.org> <20201117202317.GA282679@fuller.cnet> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mtosatti@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Fri, Nov 20, 2020 at 06:20:06PM +0000, Christopher Lameter wrote: > On Tue, 17 Nov 2020, Marcelo Tosatti 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. > > > > Are you suggesting that instead of a specific file to control vmstat > > workqueue only, a more generic sysctl could be used? > > Yes. Introduce a sysctl to quiet down the system. Clean caches that will > trigger kernel threads and whatever else is pending on that processor. OK, makes sense. About sysctl, in particular: NOTES top Use of this system call was long discouraged: since Linux 2.6.24, uses of this system call result in warnings in the kernel log, and in Linux 5.5, the system call was finally removed. Use the /proc/sys interface instead. Note that on older kernels where this system call still exists, it is available only if the kernel was configured with the CONFIG_SYSCTL_SYSCALL option. Furthermore, glibc does not provide a wrapper for this system call, necessitating the use of syscall(2). So will stick to the /proc/ suggestion. > > About NOHZ mode: the CPU should enter NOHZ automatically as soon as > > there is a single thread running, so unclear why that would be needed. > > There are typically pending actions that still trigger interruptions. > > If you would immediately quiet down the system if there is only one thread > runnable then you would compromise system performance through frequent > counter folding and cache cleaning etc. Makes sense.