Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp324786rwr; Thu, 27 Apr 2023 01:39:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RV8LPBiH6jKiwuMqB9QVwJvTZDkRj23tMeJPMgPfw4WTLOLF6BjJOwBmENTjYdjhbvS6V X-Received: by 2002:a05:6a21:78a3:b0:f1:1ab5:5076 with SMTP id bf35-20020a056a2178a300b000f11ab55076mr961417pzc.2.1682584788670; Thu, 27 Apr 2023 01:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682584788; cv=none; d=google.com; s=arc-20160816; b=BHXR1V54Vp0OmlpwxeyuONO7vataRtRDmKvhOMHYT4UfS0+x6AktA0ShWoF5totuvo OsurGYvH3nLMjmdYCogwPJ3tQVJkag/XaLZehAtDVlMDk2ABwOlcBTAcqV0dPNQDbs3B 462vqB67ONV2QdCxvxKLlUiYWd41xVONFEBgg4X+NkHUeg+akdSpam4k5vjZXdXar8eO xdldiGN/p4b5z99A9lGuVnwRKSIU2FeHtjuTxT5H6QStseO7R3weVPMuc2m0gLZqQ3M7 SXIfcigS0U7hh4wa4Uu9mCddCVVHKju2M1HNCNzGRb4RmroDL4M+7cpbpy6kv0buFBF3 gMcA== 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=lAqWxeoT6YMgHdJzhyWG3lkDvVYHyX2WVhhTgyrw/4o=; b=qwFjfTlFNMlcb/qrvqHhg5FyiTGeTSgbRGyyyVBnC+oidSXh23nUZcy9B89Hi7Q43r DO6AUOzyXI+Sg66M47heM4eKnwVuSQoTXiQbDbtep7DzPpcw+YkvSeHbmi52qs8eLVXP ZfyVZNRMiFvzbD5wTraKAUhx0lKdBbq5HsJCPCltDsddh2A/IdvyLQ1ETalsgFeQl9va 84Nn3NefH1oHkiuZEJsaky1rIwQsIrczQq5yVSO8eL6IVhvtth5GUd8FiYFxkF3VK795 RuMYbeARhRaX2K0SchyJYU/VZSumIu/y0iEtHiNHJsyeS+EK5e6NLx4FL/qwT4VxivFo vz9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="qFeK/9WW"; 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 j6-20020a170903028600b00194967b7badsi19065758plr.591.2023.04.27.01.39.34; Thu, 27 Apr 2023 01:39:48 -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="qFeK/9WW"; 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 S243146AbjD0Ib2 (ORCPT + 99 others); Thu, 27 Apr 2023 04:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243090AbjD0IbY (ORCPT ); Thu, 27 Apr 2023 04:31:24 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3050949F4 for ; Thu, 27 Apr 2023 01:31:23 -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 E2E3821A4E; Thu, 27 Apr 2023 08:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1682584281; 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=lAqWxeoT6YMgHdJzhyWG3lkDvVYHyX2WVhhTgyrw/4o=; b=qFeK/9WWgFt3omX3TNm9MjLqbsP0LlYdLsWLyHdh+KWVclDHWLa56aAfJdCDpFumUjChCB 5gA8j6gO/V+KNJmcuPCk8JxmqcCeG5Yy79zEqOqDjf1LgJkjsfZ4zASC6jV0rLpEQAkV5b LR4z1o5OwGvCfwTkQ09GxiAFv9aisdc= 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 C4DC9138F9; Thu, 27 Apr 2023 08:31:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id u9UkLdkySmQIVQAAMHmgww (envelope-from ); Thu, 27 Apr 2023 08:31:21 +0000 Date: Thu, 27 Apr 2023 10:31:21 +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: <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=-2.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,URI_DOTEDU 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 26-04-23 11:34:00, Marcelo Tosatti wrote: > On Thu, Apr 20, 2023 at 10:45:20AM -0300, Marcelo Tosatti wrote: [...] > > There are additional details that were not mentioned. When we think > > of flushing caches, or disabling per-CPU caches, this means that the > > isolated application loses the benefit of those caches (which means you > > are turning a "general purpose" programming environment into > > potentially slower environment for applications to execute). I do not really buy this argument! Nothing is really free and somebody has to pay for the overhead. You want highly specialized workload to enjoy all the performance while having high demand on latency yet the overhead has to pay everybody else. > https://www.uwsg.indiana.edu/hypermail/linux/kernel/2012.0/06823.html This is just talking about who benefits from isolation and I do not think there is any dispute in that regard. I haven't questioned that. My main argument was that those really need to be special and careful to achieve their goal and Thomas says a very similar thing. I do not see any objection to an explicit programming model to achieve that goal. > > (yes, of course, one has to be mindful of which system calls can be > > used, for example the execution time of system calls which take locks will > > depend on whether, and how many, users of those locks there are at a > > given moment). This is simply not maintainble state. Once you enter the kernel you cannot really expect your _ultra low_ latency expectations. [...] > > So it seems to me (unless there are points that show otherwise, which > > would indicate that explicit userspace interfaces are preferred) _not_ > > requiring userspace changes is a superior solution. > > > > Perhaps the complexity should be judged for individual cases > > of interruptions, and if a given interruption-free conversion > > is seen as too complex, then a "disable feature which makes use of per-CPU > > caches" style solution can be made (and then userspace has to > > explicitly request for that per-CPU feature to be disabled). > > > > But i don't see that this patchset introduces unmanageable complexity, > > neither: As I've tried to explain, I disagree about the approach you are taking. You are fixing your problem at a wrong layer. You really need to address the fundamental issue and that is that you do not want housekeeping done on isolated cpu(s) while your workload is running there. vmstat updates are just one of schedule_on_cpu users who could disturb your workload. We do not want to chase every single one and keep doing that for ever as new callers of that API are added. See the point? "Fixing" vmstat will not make your isolated workload more reliable. You really need a more generic solution rather than a quick hack. Also vmstat already has a concept of silencing - i.e. quiet_vmstat. IIRC this is used by NOHZ. I do not remember any details but if anything this is something I would have a look into. There is close to 0 benefit to teaching remote stat flushing. As I've said stats are only for debugging purposes and imprecise values shouldn't matter. So this just adds a complexity without any actual real benefit. -- Michal Hocko SUSE Labs