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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8A9DC77B73 for ; Wed, 19 Apr 2023 11:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232729AbjDSLbE (ORCPT ); Wed, 19 Apr 2023 07:31:04 -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 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.