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 74674C64E8A for ; Mon, 30 Nov 2020 09:32:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D610920809 for ; Mon, 30 Nov 2020 09:31:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D610920809 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 4706C8D0002; Mon, 30 Nov 2020 04:31:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 422DA8D0001; Mon, 30 Nov 2020 04:31:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 310228D0002; Mon, 30 Nov 2020 04:31:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 1AEAD8D0001 for ; Mon, 30 Nov 2020 04:31:59 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D0DC9BBF6 for ; Mon, 30 Nov 2020 09:31:58 +0000 (UTC) X-FDA: 77540567916.13.hope33_3917eb0273a0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 685F418140B69 for ; Mon, 30 Nov 2020 09:31:48 +0000 (UTC) X-HE-Tag: hope33_3917eb0273a0 X-Filterd-Recvd-Size: 3141 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 09:31:47 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id 503033F001; Mon, 30 Nov 2020 09:31:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 4E22C3EFF6; Mon, 30 Nov 2020 09:31:47 +0000 (UTC) Date: Mon, 30 Nov 2020 09:31:47 +0000 (UTC) From: Christoph Lameter X-X-Sender: cl@www.lameter.com To: Marcelo Tosatti 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 In-Reply-To: <20201127154845.GA9100@fuller.cnet> Message-ID: References: <20201117162805.GA274911@fuller.cnet> <20201117180356.GT29991@casper.infradead.org> <20201117202317.GA282679@fuller.cnet> <20201127154845.GA9100@fuller.cnet> 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 Fri, 27 Nov 2020, Marcelo Tosatti wrote: > Decided to switch to prctl interface, and then it starts > to become similar to "task mode isolation" patchset API. Right I think that was a good approach. > 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. Sounds good but what would this do? Give a warning like the isolation patchset? > 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). Yes good. > 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 ? Maybe do both like in the isolation patchset? Often code can tolerate a few interruptions (in some code branches regular syscalls may be needed) but one wants the thread to be as quiet as possible.