Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp137055rwr; Wed, 19 Apr 2023 04:40:06 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvdxHscz5CygpxZk3y/jO9z7LM7p/g/q/N/FphFtFXcTDb3N8tPNi+wrwKnPpwSgnVkntk X-Received: by 2002:a05:6a20:3d25:b0:db:b7:fe3f with SMTP id y37-20020a056a203d2500b000db00b7fe3fmr3732512pzi.10.1681904406069; Wed, 19 Apr 2023 04:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681904406; cv=none; d=google.com; s=arc-20160816; b=HepzMztkYdGzLyTf6xpB9B1MS/gb+T0bL3o51+FKRStHC4GXSyW8kr1rzwPzjv2CJt 2t6yAyakZscjCB3h/lVpn66Xd/wJEoJjHukuF5J5yBh16JG9PwtZOxe61H5WUxGKjKnP dM3uEKSRhxW5Or2bjWcytksMpuI+ImDVF1trjy8H45y+nWkqvmo5edNrvvKEyCZkU6lY yM5rYEM1fFtmv9A4N5W8yW24kL3/thK3qB8T26l1G7ujCEAIg3Xtlyf/V2PWBYbs+JC0 fkXKyETnOq5OvKrCaXCnQL16wlmj0sn30458pI9MARdufFaEn7ox4nah5OxSywuT9zGt y89w== 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=UR2Jr3MAlKIhW8iOV3hAaD76HU/9V535wh2bhBwPjgs=; b=yF0aRXJ4xaLfyytGA/V/EKhCDWlYqIzmsYYz3Y4c2NMHvf0OPDGSYk3h07yL1EBAxH 967feckX11lJnKpCo/MN+aZUwcOG8AFVSpUqKdt+8QwNeHMciWPb1dzDm2+Ne+DSl1GT YJiWW9rV9Hltt2EbtZDZlkJzqmmM1UXF9ECD/cF67QQ8M5xZwEpT6Qam29611os1urcu xw6YWQ4uAbRc+AjcpyMMuc5aD7YACmjGLlrdCeYeEWrFdcAZF4yp+ETKntV2o02JWUku OO9QmEDb6vbSBmP7qV6gPuRY9aeNSlYfSZZS5SYs7Qf/DExaNIkgKNxNEvCVqTK/IgPb ySiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hgtZIpVY; 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 74-20020a62174d000000b0063b2655def0si16335120pfx.47.2023.04.19.04.39.51; Wed, 19 Apr 2023 04:40:06 -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=hgtZIpVY; 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 S232444AbjDSLbC (ORCPT + 99 others); Wed, 19 Apr 2023 07:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbjDSLbB (ORCPT ); Wed, 19 Apr 2023 07:31:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28FA3210A for ; Wed, 19 Apr 2023 04:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681903816; 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=UR2Jr3MAlKIhW8iOV3hAaD76HU/9V535wh2bhBwPjgs=; b=hgtZIpVYtm4kB3q34rK+vSdbDPmkFtIib/LYDwNwo/tGkXNGGONFZLQUiOx7tccJgkfTQQ 6auN31Fi+o1YujpHSUQ7WrA/H0+hXWYXDrxERwe3inO8QqV62E/Ffrqcg2WdWSETvpJ37C KSTmPkmP4NXjrmPXpbCmlu9ARxPsn6Q= 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-183-J6WxL0LbOuqeFA_1IwyR-A-1; Wed, 19 Apr 2023 07:30:11 -0400 X-MC-Unique: J6WxL0LbOuqeFA_1IwyR-A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 307C2857FB4; Wed, 19 Apr 2023 11:30:10 +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 EB5A6C16027; Wed, 19 Apr 2023 11:30:09 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 86DC3400E0569; Wed, 19 Apr 2023 08:29:47 -0300 (-03) Date: Wed, 19 Apr 2023 08:29:47 -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.8 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: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). 3) Remotely sync the vmstat for that CPU.