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 F25CBC6FD18 for ; Wed, 19 Apr 2023 11:30:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B0608E0002; Wed, 19 Apr 2023 07:30:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85FA88E0001; Wed, 19 Apr 2023 07:30:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 727F68E0002; Wed, 19 Apr 2023 07:30:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5F0628E0001 for ; Wed, 19 Apr 2023 07:30:19 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 00AC3160241 for ; Wed, 19 Apr 2023 11:30:18 +0000 (UTC) X-FDA: 80697922116.24.43F03F0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 0DA3640014 for ; Wed, 19 Apr 2023 11:30:16 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hgtZIpVY; spf=pass (imf04.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1681903817; 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=UR2Jr3MAlKIhW8iOV3hAaD76HU/9V535wh2bhBwPjgs=; b=T9oLd5oPpKiGOjMNePBKavdWwjhK+OucKLBpdoV0hHfitTIpaWDjzBWD5WxneGF9xpiaoK bC0HO20kz4Gu64GIU/M758KrBwCD3Abiy6j7j7zyrlWSk2sZnJ4P/AA9PI6L7GmMaJuTYu rU50zKJkh/uJsfdUx0T2Lnz1DnTo01U= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hgtZIpVY; spf=pass (imf04.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1681903817; a=rsa-sha256; cv=none; b=Os4dw/lI0xcrhnkLthSGjVK+p4l6JNdk41EWbvgsLHSH31nHcZMCiQsoE/8fS16QKuQjwI l9z5Y2/A2j2BP969iLEUCc2Vm2QjLZQLgvIl3Xy0had7rucG0+CriL5x69We/lfnCbsxf9 WNXmATXbRW60/7EcsimhVKQOsUrqyTI= 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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0DA3640014 X-Rspam-User: X-Stat-Signature: kyuc1t6nouty5o7n1daakpm5hhmboghp X-HE-Tag: 1681903816-189886 X-HE-Meta: U2FsdGVkX19q7nnP1HMaHkkRIUU3AS7lHXj9MVCqCJx7QgKREQheOSIEEBMzs8ABy7Fj8svHd26htuFh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A0xyiNnu07KVJeSSjiFVfkfl2HI9WR0XKVqI29q50+FcUHnMgkIewZEwf3suohVMPf6U= 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: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.