Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp563622rwr; Wed, 19 Apr 2023 09:58:12 -0700 (PDT) X-Google-Smtp-Source: AKy350YnkfJT73TMi/m4Ns809XV5+HcF+sTX/oyVvE27znK9YBKRZYV8d9jIkbsptqmNPwXUDp15 X-Received: by 2002:a05:6a20:918c:b0:ec:6e2d:5a32 with SMTP id v12-20020a056a20918c00b000ec6e2d5a32mr4499724pzd.62.1681923492627; Wed, 19 Apr 2023 09:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681923492; cv=none; d=google.com; s=arc-20160816; b=nx0Uy1EoI7R2/Fra0NCLUBG3tniZ//Z3LpyOIgNhK/i3WRsNHAm9nuu8vc7cPMeaTg BdBraqMumGpFlPW6n4M4zJ42MkG18f8Ll9tV2afzY+UiVVH7YEF0BCI3meIoC/OmshdB pn9nSQNTL8S5kj/PthjoLq7bnAy0NkKXvlnV3a80bI2/bfpGrpXRiaxhSR0zAv6wig1U D3r7J0w+F2YpXkw9curnlGFDdmJvdynD9HabHRS5YBt57+tS0zmWInRWt4sugtLlvmdT GjhNMEQ7cWGdXQJCiPgw7LyBNnVB6x3vX/sPmhfjUBBbf+yIldUS/csqfNUsKZTMj+2a eikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=FpvbNxqBfyk9qoJ839TZe3utQ4E0pWLzfA0YkThOt6Mx9nZmJsPqq1nXHxMcFwtVQj ascbXPuI5mXUzL6/XiZF1eTsr6jbH7hyfjByueSl8Mp2C0l2AQks2/vaytd99E4q32n3 SkXkvkwJX5GQBA3ZUGhfz2llNBEfd7Jk3FVdDL0Fal+0CD8DdTP2GkCLFMY59Y8MgLQ7 5jIs5bKjCroUyQ00pFW9lXnt6y6BbJiVXVH5MFr2HIQumU/fHFkHyZawX2iTIaEHTqsO A22AT7BkJCDotdKZZ3dx6ReTHJYnCUkTnSnmYcgknR3LQVm+X4KJbYp0brLFFkUJ5lSO PPHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HeixTkZD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a655604000000b0050bea5bf413si16758660pgs.705.2023.04.19.09.57.55; Wed, 19 Apr 2023 09:58:12 -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.cz header.s=susede2_rsa header.b=HeixTkZD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233094AbjDSQrn (ORCPT + 99 others); Wed, 19 Apr 2023 12:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232588AbjDSQrl (ORCPT ); Wed, 19 Apr 2023 12:47:41 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62CC270E for ; Wed, 19 Apr 2023 09:47:32 -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-out2.suse.de (Postfix) with ESMTPS id 6B78D1FD98; Wed, 19 Apr 2023 16:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1681922851; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=HeixTkZD59JVtb74nipavgvSlQn//sMl5NVsI/y3gPbSs2BeoMGqEqoXJJsV9xLOSGB/GY Xm4u2uK/dTxrNE566wDiVRuAZRsG/kqBpARc+Aa3Nn/sa8/ozNxFYQ+RjsEUZb/Rtx+awD ooTJQu3kUUYWyCXhpDziWkrvipzuM5s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1681922851; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=Qq1iYoqPtPkJNNrXPQltI6ODmAFphQxpVDVdEFN6p+jUgu0P3afq91021gagmRxGPpRQas PQvIHvuU7yB45NDg== 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 2C73613580; Wed, 19 Apr 2023 16:47:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7nSaCSMbQGR3QAAAMHmgww (envelope-from ); Wed, 19 Apr 2023 16:47:31 +0000 Message-ID: <1a481d68-930e-9418-a9aa-befdcfe36928@suse.cz> Date: Wed, 19 Apr 2023 18:47:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v7 00/13] fold per-CPU vmstats remotely Content-Language: en-US To: Marcelo Tosatti , Andrew Morton Cc: Christoph Lameter , Aaron Tomlin , Frederic Weisbecker , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King , Huacai Chen , Heiko Carstens , x86@kernel.org, Michal Hocko References: <20230320180332.102837832@redhat.com> <20230418150200.027528c155853fea8e4f58b2@linux-foundation.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 4/19/23 13:29, Marcelo Tosatti wrote: > On Wed, Apr 19, 2023 at 08:14:09AM -0300, Marcelo Tosatti wrote: >> This was tried before: >> https://lore.kernel.org/lkml/20220127173037.318440631@fedora.localdomain/ >> >> My conclusion from that discussion (and work) is that a special system >> call: >> >> 1) Does not allow the benefits to be widely applied (only modified >> applications will benefit). Is not portable across different operating systems. >> >> Removing the vmstat_work interruption is a benefit for HPC workloads, >> for example (in fact, it is a benefit for any kind of application, >> since the interruption causes cache misses). >> >> 2) Increases the system call cost for applications which would use >> the interface. >> >> So avoiding the vmstat_update update interruption, without userspace >> knowledge and modifications, is a better than solution than a modified >> userspace. > > Another important point is this: if an application dirties > its own per-CPU vmstat cache, while performing a system call, > 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). So you're saying the application might do a syscall from the isolcpu, so IIUC it cannot expect any latency guarantees at that very moment, but then it immediately starts expecting them again after returning to userspace, and a single interruption for a one-time flush after the syscall would be too intrusive? (elsewhere in the thread you described an RT app initialization that may generate vmstats to flush and then entry userspace loop, again, would a single interruption soon after entering the loop be so critical?) > 3) Remotely sync the vmstat for that CPU. > > >