Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp163255rwr; Wed, 19 Apr 2023 05:03:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aoOBE5MR0llWraA/9PCkqCah+Q6dEz/fV+OaFe8cfCA4s1IsiLkCcjo4TJvn5zr9kxOxcZ X-Received: by 2002:a05:6a21:32a2:b0:e9:5b0a:deff with SMTP id yt34-20020a056a2132a200b000e95b0adeffmr2646437pzb.22.1681905819483; Wed, 19 Apr 2023 05:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681905819; cv=none; d=google.com; s=arc-20160816; b=up13nkATNZe/MD9zxcl8p+GnMEF3AneC5tE99yymWxNWFCUz5zyS6X4T9Ul2qvQKTy IscL9fqTs7F+khwDr5MNcfv3JP7Ut4FDmsYl1VdzbrapBm38bCKxz7nQJLNBwj/+dLGE JCbk6wWfxFQo6IqcWGJgi4WZqRBEbQtJowkhsuwu5LaNnikMDakZWYOcF/dyzXp6RjlC WkWM3P6jbHeIFjNEfoxEFCzl33jknvmjewV+lbaVjIpIPYvj6ulis2Bm9zEW/ZZz+MIG LOpz1071KcGhuY1V8r5t8HU+J0f9MhpJgRC8pagE5mKomiU/IP+UsmL1eXwQyTXMu/BF EKRA== 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=GgJsIrXz2K4kfjtSt6CE3VKf8/GPSBf/X6+HAGfKUzI=; b=IEZ2QVO0CplDRhmsNIqr6L2L9rQGDQ44La3sVpCn9mxHrhdFQOU9WQ1zUzJLFhds3A B9mc5b8FTG4rAIq+DA56i765IqSz2Jj8EWKqbQY1ZzCOD3W42CIZaM6AdZfSjM2xh9Og S+fSThJgwONd7II6bKTRYE1MwtKiLMM5DAtST2322FJSntaRCjDs5YWDtnP4a8ehEx5b yJTPDSZfug3oce/473IfLSyu7CoSvDK5H2s2O2/LEr68elHgaGEAbW19CFB57jmkIsCJ j79K3EiRwKDVI6K0nQJSE/zUkljKnpA5HdWKTQBu4gJ/2uXLnOkgate8GzeIZBJ4CMwo CvIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="CtkfQU/d"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y36-20020a631824000000b0051b603fe4f9si13744726pgl.876.2023.04.19.05.03.09; Wed, 19 Apr 2023 05:03:39 -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=@redhat.com header.s=mimecast20190719 header.b="CtkfQU/d"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233108AbjDSMBY (ORCPT + 99 others); Wed, 19 Apr 2023 08:01:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232662AbjDSMBS (ORCPT ); Wed, 19 Apr 2023 08:01:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BAB314F77 for ; Wed, 19 Apr 2023 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681905596; h=from:from:reply-to:subject:subject: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=GgJsIrXz2K4kfjtSt6CE3VKf8/GPSBf/X6+HAGfKUzI=; b=CtkfQU/d6z8QVLOpqQZF7Fqpatvu7nEbEmg89kvgSjw0AKpCza5X1liEKQLTEkIK0wckrX 2aDwSUTSiRlyaHYq4THxFrY0DpxalbEmHxlhJz9vuLS42/+PMhXq23+cpaM5yYXec0xv8K LIM5Ly82UUWD8mhC2ilO0Vv9J6mmNgc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-Z0iXaEeHMbC2T1VUriRtww-1; Wed, 19 Apr 2023 07:59:51 -0400 X-MC-Unique: Z0iXaEeHMbC2T1VUriRtww-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD271884ECF; Wed, 19 Apr 2023 11:59:50 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F07CA2166B36; Wed, 19 Apr 2023 11:59:49 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 2D69A40E019C9; Wed, 19 Apr 2023 08:59:28 -0300 (-03) Date: Wed, 19 Apr 2023 08:59:28 -0300 From: Marcelo Tosatti To: 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, Vlastimil Babka , Michal Hocko 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-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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, Apr 19, 2023 at 08:29:47AM -0300, 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, Or while handling a VM-exit from a vCPU. 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.