From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 363C6C6FD18 for ; Wed, 19 Apr 2023 12:00:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA0848E0002; Wed, 19 Apr 2023 07:59:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A512E8E0001; Wed, 19 Apr 2023 07:59:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 919048E0002; Wed, 19 Apr 2023 07:59:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7EA208E0001 for ; Wed, 19 Apr 2023 07:59:59 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 46580ABA75 for ; Wed, 19 Apr 2023 11:59:59 +0000 (UTC) X-FDA: 80697996918.25.6D896B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id BDF181C002B for ; Wed, 19 Apr 2023 11:59:55 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hSuvb+rt; spf=pass (imf18.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681905596; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GgJsIrXz2K4kfjtSt6CE3VKf8/GPSBf/X6+HAGfKUzI=; b=3Re1bxfC1+myNjffv19wpkH4I323YiKYKa+oT9Vf1h4mGTIzXYFVPYcuvx/ZGjD5OtVJTq e4QAuZFkOiWGb1DaeB+5K64aXOyKou/e7ygI0EUj6QhW00KTwsFDBF2AQE3z0/CBtYMO/L qNyXSeA0GGMvNEcoKGGTYLZBP+h90OE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hSuvb+rt; spf=pass (imf18.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681905596; a=rsa-sha256; cv=none; b=yJH3NRIA2LjNmze9p2Q2YPVXmgc87+C2sA39t7emoh0dPmk1ESV0xU3k8I/YEJNcFDLt79 PxHxX7HsUbNsOhxHtSh7RgOzoY9LxuiC8VRn13E8wabP6ofVvKv9CsZUv6OOYCK1ei4TeU LA15Gm1SpmBdTSjkJEnKgLwNai12wf0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681905594; 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=hSuvb+rtjNce388/E5YrUjDNWYsOJljyNyaD7wchVmWVafOjSgKNVTWALoNYENAXDtJYmK Bgx4J9q8mO7bfSBuR+qtKkzDazLHspKIjD8IuIw92VgQe7XTAu+xckhj43I8+aOr015nOo 13AqR1WB8Hh8vziMJCmcYvYafw3eScU= 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-Stat-Signature: a6hstc8nfmxpczawb84tm6xrb7btfi9x X-Rspam-User: X-Rspamd-Queue-Id: BDF181C002B X-Rspamd-Server: rspam06 X-HE-Tag: 1681905595-749480 X-HE-Meta: U2FsdGVkX18DXz80KcLDck1Pp5XQxrZqiZnYsfoQ58EacDXJCOCAtX6if+pZ4j0IQ9Z4y0jObh3zAZztLJV83L81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f3NzeakvuMWvzy3fvKGlMJfjpv/sD9QLmIabaYV+WNlQY9mlg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.