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 3B4ECC77B72 for ; Thu, 20 Apr 2023 08:40:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D63DF900004; Thu, 20 Apr 2023 04:40:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D13F4900003; Thu, 20 Apr 2023 04:40:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDE03900004; Thu, 20 Apr 2023 04:40:29 -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 B1329900003 for ; Thu, 20 Apr 2023 04:40:29 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 84AAEC041C for ; Thu, 20 Apr 2023 08:40:29 +0000 (UTC) X-FDA: 80701122978.02.7B53806 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf06.hostedemail.com (Postfix) with ESMTP id 8331B180019 for ; Thu, 20 Apr 2023 08:40:27 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=vEM1P4IF; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681980027; 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:dkim-signature; bh=psUcnuY/w561sLF9FEzotMA5NMwI4obQ8dTonjhOYWQ=; b=E+GCb0d0WGBbwU3up/3R8cANzgLZIQQNZk+5LDO1GAoMaVsG3tYZjGZVcZEXsUT0B+kTFJ TJ/b5w3afmWm9a2fWe1iTqytd37rZc3KUsB2mXohk9wVhQRVw5MdkzL4Q97vd1U5ze0YIh b0UHqJ0xP4wWO97qdPNyPYsigDEx5es= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=vEM1P4IF; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681980027; a=rsa-sha256; cv=none; b=wakGvoFVFWav5yb9LKyYhsxyNZzphTvaNBgkRPwEqiuzvVqGzaHiIHfzZK8gCCdpv/9Yqt CRA/NtAQGZQFlTk70UqcWXcwPCV8iswRaJS1gHy/8p6feTMcpcRV1GRk54Q5UcK12AHy9m ZbLn08DSWcsR2gM9ULygziHB9ybncOI= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DE9A72188F; Thu, 20 Apr 2023 08:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1681980025; h=from:from:reply-to: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=psUcnuY/w561sLF9FEzotMA5NMwI4obQ8dTonjhOYWQ=; b=vEM1P4IF7e2R2tj9sfsDmTf1Y8+LO0GGYN9OH9KqScwkYgNEmoqUVXvbhT8G14JIQ/6Tie gbBTccs8gMqtmQ134Ulr4wrkWDSyMRxBCaxrzXYYSBsPmwKbPnNa5TbyOpFZLaqI2msPJj FFZQ3ftw9NgMa0fPe4RmYqzKyNs/8Uw= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BE2E61333C; Thu, 20 Apr 2023 08:40:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7lwYLHn6QGRBdQAAMHmgww (envelope-from ); Thu, 20 Apr 2023 08:40:25 +0000 Date: Thu, 20 Apr 2023 10:40:25 +0200 From: Michal Hocko To: Marcelo Tosatti Cc: Frederic Weisbecker , Andrew Morton , Christoph Lameter , Aaron Tomlin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King , Huacai Chen , Heiko Carstens , x86@kernel.org, Vlastimil Babka Subject: Re: [PATCH v7 00/13] fold per-CPU vmstats remotely Message-ID: References: <20230320180332.102837832@redhat.com> <20230418150200.027528c155853fea8e4f58b2@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8331B180019 X-Stat-Signature: np48adkij7ah5bqj9qjo4cr9ze5ji3sp X-Rspam-User: X-HE-Tag: 1681980027-799301 X-HE-Meta: U2FsdGVkX183QEddbVKVdvDKs+6sga6J5kSN51BlIrNckJ0TBPpw5GQdDc1JA3WqTF46hqiE5U29eyU+pqhRj8N0kOGYTQ4mLPOiI/nD7P5MLvasjud9FsqZvTsKcIt6n8CtZSQt2PB0SQpnlDdLwLuz/Z5sbAF6YzGDohrXN+u+bet/CaAJlqLkuW7MW6hIsnmNc4jFdDEwJD7EhuMlvQwuvWlbdjaID1gKhF14bqYlv69rvnmFpY3tsuJHBKqxu8OWFZTXxz5QwP/9/1pNgmQhgcHTbudI8iDquzgAwpYWS9b2zngCbPzhazw9GzIBjy/PsVKlOMsnhJ6/CdJ1xo6KGbpQWGuTmhgGDGWnJeNL5GfqVkRCCARSX2x2s9FaDLbRzZBcgPBTvvXjLEU7PINtt37yo7Jwg26UIOCezY3o6tik4YGmEA/50W6tVsCAz3c1lSYImp91wqUFR77FQUQvl+Bk8a/r+Gv4m/OWFwUGA7wp0TbWgvcg6kW/081C34fLFifLZiV3tdr2sofhnYBhF15lUKYz0i4dD0TXxmvN9WORO8VrdhVcV/Gwrf4QcOSqTPFH1k07modTujht5Qkl5V2n/22vn0YKGo3lsMmESSSoLvG+KOwcGqs97LJRgZB9u8dDh30RMAubGLCx9URbYPpRFgII/vKquOmFkxdQcJX0L+khv9WgbWBe6cGXSFa358/AuGQ/pa8L4uvGY+318A547RwQGsJKZxgkO9hmc005hbBmL0fC3CDyngFPMSRQ/nFzhfvM83mkdWZs+OzZYHRqZEEvyawJfcQVSWiX6HyAqPJZC0fqv2eFB4DskPPBMDe7ngEZTzN/xlJIDcHPRL9RTjhES3Es5uY3Te1vKHJrL3dJwwQd3IozJM5X2BdslmygeQyr9XDoo2RHjsxqCKSEmMhPNnqtRBaoUI1/qLACDTahx+TtMrAcd5aztyt62CO7Ex+1CZm4Wup +v+cD+qy tF7J12s8zaBXaGUKG4zGRvSN0r+/Bkh7m7cl1K4iT39UCWVuqQxCQVjHxD46i4it+HBBKHUikJsSqY7z0FlCAlh0nEO0/g9WkPkU5PfPPpVG3MqxMt25CziKp9RWo3eroFkZIJNsp1uqTww35cc2pUqicV/oCWmlVpLkh2wUCahfHnxVk5LEaCC+YGeX79DOG1Tgze42vLvJtOkTgHCRBqpZJiyUGs3zemxYi 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 Wed 19-04-23 13:35:12, Marcelo Tosatti wrote: [...] > This is a burden for application writers and for system configuration. Yes. And I find it reasonable to expect that burden put there as there are non-trivial requirements for those workloads anyway. It is not out-of-the-box thing, right? > Or it could be done automatically (from outside of the application). > Which is what is described and implemented here: > > https://lore.kernel.org/lkml/20220204173537.429902988@fedora.localdomain/ > > "Task isolation is divided in two main steps: configuration and > activation. > > Each step can be performed by an external tool or the latency > sensitive application itself. util-linux contains the "chisol" tool > for this purpose." I cannot say I would be a fan of prctl interfaces in general but I do agree with the overal idea to forcing a quiescent state on a set of CPUs. > But not only that, the second thing is: > > "> Another important point is this: if an application dirties > > its own per-CPU vmstat cache, while performing a system call, > > Or while handling a VM-exit from a vCPU. Do you have any specific examples on this? > This are, in my mind, sufficient reasons to discard the "flush per-cpu > caches" idea. This is also why i chose to abandon the prctrl interface > patchset. > > > and a vmstat sync event is triggered on a different CPU, you'd have to: > > > > 1) Wait for that CPU to return to userspace and sync its stats > > (unfeasible). > > > > 2) Queue work to execute on that CPU (undesirable, as that causes > > an interruption). > > > > 3) Remotely sync the vmstat for that CPU." > > So the only option is to remotely sync vmstat for the CPU > (unless you have a better suggestion). `echo 1 > /proc/sys/vm/stat_refresh' achieves essentially the same without any kernel changes. But let me repeat, this is not just about vmstats. Just have a look at other queue_work_on users. You do not want to handy pick each and every one and do so in the future as well. -- Michal Hocko SUSE Labs