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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84111C07E9C for ; Mon, 12 Jul 2021 09:09:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DBAA6115C for ; Mon, 12 Jul 2021 09:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350805AbhGLJLr (ORCPT ); Mon, 12 Jul 2021 05:11:47 -0400 Received: from vmi485042.contaboserver.net ([161.97.139.209]:60544 "EHLO gentwo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346305AbhGLJIt (ORCPT ); Mon, 12 Jul 2021 05:08:49 -0400 Received: by gentwo.de (Postfix, from userid 1001) id 00698B003AE; Mon, 12 Jul 2021 11:05:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id F1AFBB00352; Mon, 12 Jul 2021 11:05:58 +0200 (CEST) Date: Mon, 12 Jul 2021 11:05:58 +0200 (CEST) From: Christoph Lameter To: Marcelo Tosatti cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Frederic Weisbecker , Juri Lelli , Nitesh Lal , Peter Zijlstra , Nicolas Saenz Subject: Re: [patch 3/5] mm: vmstat: optionally flush per-CPU vmstat counters on return to userspace In-Reply-To: <20210709174428.241607867@fuller.cnet> Message-ID: References: <20210709173726.457181806@fuller.cnet> <20210709174428.241607867@fuller.cnet> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Jul 2021, Marcelo Tosatti wrote: > + > + if (!static_branch_unlikely(&vmstat_sync_enabled)) > + return; > + > + cpu = smp_processor_id(); > + > + if (housekeeping_cpu(cpu, HK_FLAG_QUIESCE_URET)) > + return; > + > + per_cpu(vmstat_dirty, smp_processor_id()) = true; > +} And you are going to insert this into all the performance critical VM statistics handling. Inline? And why do you need to do such things as to determine the processor? At mininum do this using this cpu operations like the vmstat functions currently do. And, lucky us, now we also have more issues why we should disable preemption etc etc while handling vm counters.