Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp466967rwr; Thu, 20 Apr 2023 01:49:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZqVn/P4SZ7fvAP3qUtEVsNiGef4fvHK2Iz3HC7Zi2GGVqy3NuFMBpGsGv5H4Jtt7YqNiXH X-Received: by 2002:a17:902:e884:b0:1a0:50bd:31c0 with SMTP id w4-20020a170902e88400b001a050bd31c0mr1026997plg.24.1681980580513; Thu, 20 Apr 2023 01:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681980580; cv=none; d=google.com; s=arc-20160816; b=Uf2dZLpPdju5cds1sjWcvjbtXhZQaP5WH2km375xlnSXxKxrlTT8a6EreDVQByOnph z7Z6yUcIlH6ZJnoPPh8Z+k4XcEpItbJ/flQzKbrRgMd6gYUTu8EJiidCt3M2cabZk3lU fX36SnFWSJCQa/Du46RrAFtzsJjiu9uv0TyarNC6sE/MzbMmamTNBd0psMSzK/BWxI1V +5ZdyfEAW6r+mqjFRR6i9C5gnx60RoxKxyou2tDxwp68NGl+mCcxBjmAbD21v2Zawrhl QMvVOQQoJWjok3dyKSA58SPkq96uVkSXeVICBx3wi2GUVtFmKyC7e3lFFKRXEBpf2pVb ckSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=psUcnuY/w561sLF9FEzotMA5NMwI4obQ8dTonjhOYWQ=; b=mUbyn3LINlxRT1UBAXW/z6tUDxobMiXD97af52WCVfK/zyDGkKs080Tj7/tRKs9dso pfeJbOmaWLpmbH3iwUzXR4FeDBweta/Ku6iWl/ss6qwG/56O//+Y5HmPAKaeBWzUIfvs pYck4emoTeDU95+IZUxVoKnnvhDegZDdDFLvVTCZfTBUhf9t1uL3sDXP/6BCdkw1aNhC 2WG77ndWA7ILOVCiTli5ZmruObwD+Ltv17wUDOeVoZiCCdptl+DnaNxRU6/iywHtJ/VU WWYRMmUrOixFz3u/BqWx0y6r3mxDnrOCLxFUxcqVvz7HX8JkMBI3WvFB+vKMmrvnpurV /p8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=vEM1P4IF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a170902784b00b001a816a7c374si1083851pln.346.2023.04.20.01.49.26; Thu, 20 Apr 2023 01:49:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=vEM1P4IF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233990AbjDTIka (ORCPT + 99 others); Thu, 20 Apr 2023 04:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjDTIk3 (ORCPT ); Thu, 20 Apr 2023 04:40:29 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C398340C7 for ; Thu, 20 Apr 2023 01:40:27 -0700 (PDT) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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