Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3054651rwb; Mon, 16 Jan 2023 03:09:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsqusjC2OJ9tedZiToXzb/X0tRHZ31m0S05aaWgPLbSORiw7O43/epEB/7GVUQ5ZKvUSIjI X-Received: by 2002:a17:90b:3d0b:b0:229:7d9d:c47f with SMTP id pt11-20020a17090b3d0b00b002297d9dc47fmr2661944pjb.41.1673867346802; Mon, 16 Jan 2023 03:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673867346; cv=none; d=google.com; s=arc-20160816; b=NHoGXMQyWYDYnRvXaw+9ocED0CQIvzXQqFjzb0LRI+H+WqvDV1khmu9ZbPUyj+L4dL WgSdZf1p3AwV37QtkB/8OStlRtN3yGzYkskLGvCf+qefkGsVEI7BZStaz5HBfCR+pckn 90sJl1vuQtj4ZMDSrDUBDdr9cwSutcpkvZt/TwsiyzNH08xmNbaX+DPJ79UI/GvDcR4o 8HSgUNVVZ4wUEMN7z/wjM6E3gfSk8UilVEvg478v40LfI2AGAFLYFAPiBMjYPzMv/5C4 hzPcVqH4NLxn0mBmFV2MJRy0Ipiw87SZsqEP+YoJtj7JWiMr3rD8hTw+XdofmojFdbPO 6/Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=GGWZqurGVXYXKjiSWb48WruguAOsrq5zDLR1T8LYJYQ=; b=CnQ98DHzGRrUa+goSyJKaYfHylk9XdvY5CD21UrOHrAMAtqCCcXhT8u8tdHipMtDdr TEbF4F/Ea9W/Y1oLK/00tYYrlJgm5HHBfZRzJanHhyG/oMCimS7AOVofck/zahi9NalH 3htIDAD6FY94r7qt9pc1Wr33qEhFnBRZbHcDZy0eiCiUGGRbi68ofseLVGTOukZXsZeD 2M6tDsqVZ/gtb5T3ZMYObMTWiM8g79VpeXPbDoc/x69IBKCBD6QmKvG6tB+Ea/mxflKZ sqxxZelYNdcLhLUzBP7h1WCsgtcxWM4Af0Nc6nv1uMf/AE8akkEuJV+BS3NhuhO+7tsM OVEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b="Dv/Ykebi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gentwo.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw5-20020a17090b180500b0021924a18b39si8532573pjb.96.2023.01.16.03.09.00; Mon, 16 Jan 2023 03:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b="Dv/Ykebi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gentwo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbjAPJxF (ORCPT + 51 others); Mon, 16 Jan 2023 04:53:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjAPJwa (ORCPT ); Mon, 16 Jan 2023 04:52:30 -0500 Received: from gentwo.de (gentwo.de [161.97.139.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE0118B2D for ; Mon, 16 Jan 2023 01:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1673862700; bh=GGWZqurGVXYXKjiSWb48WruguAOsrq5zDLR1T8LYJYQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Dv/YkebidJycejB8ZSKlLlgZmGWe7U0ihJbL01oIY8LfRzd2tv0dOC0HeB7LW69mk aJ57mUEGBsrA+1f5RBFOfzYDk84PtIkPCGrGfn3nRMTCgCoSjxXI98n4qBLgJZLF+W yS2Q/n8mRXsnjdQyg/SArqy7/zwlmiTaFlmdZ1LiWWmgMhCvaFxbCXOJZ9Qbig4MIW RDxlRONX7K02+GASBsxBV/PFdl6/gTNONUe9XXVoIDpGfnnTt3nE7uxQBXCr9Dfrdn 98g9uk5URmbgOK2EKBS+rDFlRbS9k2eiIaYXLKdCefFaPdva4rK3BOJK43zD/AytSz C4r95u1zb2qbg== Received: by gentwo.de (Postfix, from userid 1001) id 447CFB00195; Mon, 16 Jan 2023 10:51:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 43326B0011F; Mon, 16 Jan 2023 10:51:40 +0100 (CET) Date: Mon, 16 Jan 2023 10:51:40 +0100 (CET) From: Christoph Lameter To: Marcelo Tosatti cc: Frederic Weisbecker , atomlin@atomlin.com, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, pauld@redhat.com, neelx@redhat.com, oleksandr@natalenko.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v13 2/6] mm/vmstat: Use vmstat_dirty to track CPU-specific vmstat discrepancies In-Reply-To: Message-ID: <24ca2aad-54b2-2c3a-70b5-49a33c9a33@gentwo.de> References: <20230105125218.031928326@redhat.com> <20230105125248.813825852@redhat.com> <7c2af941-42a9-a59b-6a20-b331a4934a3@gentwo.de> <60183179-3a28-6bf9-a6ab-8a8976f283d@gentwo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Jan 2023, Marcelo Tosatti wrote: > OK, can replace this_cpu operations with this_cpu_ptr + standard C operators > (and in fact can do that for interrupt disabled functions as well, that > is CONFIG_HAVE_CMPXCHG_LOCAL not defined). > > Is that it? No that was hyperthetical. I do not know how to get out of this dilemma. We surely want to keep fast vmstat operations working. The fundamental issue that causes the vmstat discrepancies is likely that the fast this_cpu ops can increment the counter on any random cpu and that this is the reason you get vmstat discrepancies. Give up the assumption that an increment of a this_cpu counter on a specific cpu means that something occurred on that specific cpu. Maybe that will get you on a path to resolve the issues you are seeing.