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 E42C0C11F68 for ; Fri, 2 Jul 2021 08:00:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3EEE61411 for ; Fri, 2 Jul 2021 08:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbhGBICr (ORCPT ); Fri, 2 Jul 2021 04:02:47 -0400 Received: from vmi485042.contaboserver.net ([161.97.139.209]:58512 "EHLO gentwo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbhGBICq (ORCPT ); Fri, 2 Jul 2021 04:02:46 -0400 Received: by gentwo.de (Postfix, from userid 1001) id 7720FB0079B; Fri, 2 Jul 2021 10:00:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 7601BB00255; Fri, 2 Jul 2021 10:00:11 +0200 (CEST) Date: Fri, 2 Jul 2021 10:00:11 +0200 (CEST) From: Christoph Lameter To: Marcelo Tosatti cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Frederic Weisbecker , Juri Lelli , Nitesh Lal Subject: Re: [patch 0/5] optionally sync per-CPU vmstats counter on return to userspace In-Reply-To: <20210701210336.358118649@fuller.cnet> Message-ID: References: <20210701210336.358118649@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 Thu, 1 Jul 2021, Marcelo Tosatti wrote: > The logic to disable vmstat worker thread, when entering > nohz full, does not cover all scenarios. For example, it is possible > for the following to happen: > > 1) enter nohz_full, which calls refresh_cpu_vm_stats, syncing the stats. > 2) app runs mlock, which increases counters for mlock'ed pages. > 3) start -RT loop > > Since refresh_cpu_vm_stats from nohz_full logic can happen _before_ > the mlock, vmstat shepherd can restart vmstat worker thread on > the CPU in question. Can we enter nohz_full after the app runs mlock? > To fix this, optionally sync the vmstat counters when returning > from userspace, controllable by a new "vmstat_sync" isolcpus > flags (default off). > > See individual patches for details. Wow... This is going into some performance sensitive VM counters here and adds code to their primitives. Isnt there a simpler solution that does not require this amount of changes?