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 739B9C2D0E4 for ; Fri, 27 Nov 2020 15:49:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0495E22244 for ; Fri, 27 Nov 2020 15:49:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TxyiaOFR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0495E22244 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 40C976B005C; Fri, 27 Nov 2020 10:49:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 395FC6B006C; Fri, 27 Nov 2020 10:49:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25E406B006E; Fri, 27 Nov 2020 10:49:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 0AFBB6B005C for ; Fri, 27 Nov 2020 10:49:21 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C624E181AEF30 for ; Fri, 27 Nov 2020 15:49:20 +0000 (UTC) X-FDA: 77530632480.22.spade78_47078cf27389 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 8C3E11803B058 for ; Fri, 27 Nov 2020 15:49:20 +0000 (UTC) X-HE-Tag: spade78_47078cf27389 X-Filterd-Recvd-Size: 5171 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Nov 2020 15:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606492159; 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=ojQrdjJlZPGDeOQaV2D6RRkXzdMB9cEzLPdTrFqv0HQ=; b=TxyiaOFRZ9xYKUPw3q7fCZwwuL96ULxHhp/V6whxUh5PBB5BDrH+7sVV6qa7+f0NoGpnjY Og3nuOHTJ6kiOXxWVsxilnZKRwMeobtRaIsQwlWxdqvMy7HvuYTjsIK9TuzUdIeIgmISfo gBwqLUJfihFC2OTZPsQlOXwSDXAOHYI= 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-541-NRDqKE4MOEKjMc8ojL3dXQ-1; Fri, 27 Nov 2020 10:49:15 -0500 X-MC-Unique: NRDqKE4MOEKjMc8ojL3dXQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5414D87950D; Fri, 27 Nov 2020 15:49:13 +0000 (UTC) Received: from fuller.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EABC6100164C; Fri, 27 Nov 2020 15:49:12 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id DCC4E4172ED9; Fri, 27 Nov 2020 12:48:45 -0300 (-03) Date: Fri, 27 Nov 2020 12:48:45 -0300 From: Marcelo Tosatti To: Christopher Lameter Cc: Matthew Wilcox , linux-mm@kvack.org, Andrew Morton , Alex Belits , Phil Auld , Thomas Gleixner , Frederic Weisbecker , Peter Zijlstra Subject: Re: [PATCH] mm: introduce sysctl file to flush per-cpu vmstat statistics Message-ID: <20201127154845.GA9100@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.84 on 10.5.11.22 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. > > > 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. Christopher, Decided to switch to prctl interface, and then it starts to become similar to "task mode isolation" patchset API. In addition to quiescing pending activities on the CPU, it would also be useful to assign a per-task attribute (which is then assigned to a per-CPU attribute), indicating whether that CPU is running an isolated task or not. This per-CPU attribute can be used to, for example, return -EBUSY from ring_buffer_resize() (or any other IPI generating activity which can return an error to userspace). So rather than: prctl(PR_QUIESCE_CPU) (current interface, similar to initial message on the thread but with prctl rather than sysfs) To be called before real time loop, one would have: prctl(PR_SET_TASK_ISOLATION, ISOLATION_ENABLE) [1] real time loop prctl(PR_SET_TASK_ISOLATION, ISOLATION_DISABLE) (with the attribute also being cleared on task exit). The general description would be: "Set task isolated mode for a given task, returning an error if the task is not pinned to a single CPU. In this mode, the kernel will avoid interruptions to isolated CPUs when possible." Any objections against such an interface ? [1] perhaps a name that does not conflict with "task mode" patchset is a better idea.