Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7226466rwl; Fri, 30 Dec 2022 05:35:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXs7iQzalU9QurVFwZxV0LAgntzcUhAf01a/r+NvUW+VsX/sd/fegVCFrkXJ5KDgcK9zW18N X-Received: by 2002:a05:6a20:8f1c:b0:a9:d06b:ef2 with SMTP id b28-20020a056a208f1c00b000a9d06b0ef2mr49135744pzk.36.1672407320511; Fri, 30 Dec 2022 05:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672407320; cv=none; d=google.com; s=arc-20160816; b=H5qnWXYVkupkZU4T+CZWPVSRwkmVtV1vw9m/kL6FS6+enLhWaePEuFUOEhCf5mSrh5 pVMQPamu+4q2fdEc3sXPh4nns19gyxfN+p26s+gpK6mVehdegiZYIzCyYeHSsKKjIXRB 9XPwbwT7v4Nf7RM6EKdrGDBKtTHMX/U7lKucwaUlK4tN5kU01whkfstRE2o8OU5uhrGO 1MBgQR7GTpGVBN++31NI9FLXqPVMWpoWehKXw0gVTylQyr0neTUt7Hd9PdWxggZwVoaO TfFbZUnUnXtZiiNX1VcO5Jci2JUzQqEYU7QiurEhRpl6SwxPoRVuE0W6h8Q0yFJ1FQQO ch2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4jBApHay/Y2Pb+S9z4zvfVXmhA3MyKdi2+ZtE0uVCW8=; b=D/zqN08oQ8/RQ1s5tw8+pXgYojBkayHdqb7RRjJLLfbBIOZQt0oLqPkppp/BxMeh7J LuZLsRsTkdRNLeKZqZvLr8sRJ+TRhQhSlLGnbF666DjsdW5nVMtQqGkb2wU6mUzG6Dzw s8VVXDSZWiHLPAVBAuwNDxRLtdaSV9qYH9jm4E4SIbx6t5tkiUljsRq71XsJUCkt45Qf rUVf8FgKVUvzPI8ltRkNxFSrdCLu5IIzu7/QMg4xKhkTZ+NJF1a9VdFU/LqAL9V1yIG0 auPX21qbAUiQdsGWfjACyyOcZcZAJa0xXUKyD9AcznuEiqb6oWuPcRKU2ME6jtjfE4Ri 2PZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=THS0fZnV; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg11-20020a056a02010b00b0049876520724si15842697pgb.303.2022.12.30.05.35.12; Fri, 30 Dec 2022 05:35:20 -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=@kernel.org header.s=k20201202 header.b=THS0fZnV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235001AbiL3NVs (ORCPT + 64 others); Fri, 30 Dec 2022 08:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234992AbiL3NVi (ORCPT ); Fri, 30 Dec 2022 08:21:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312E71ADBC for ; Fri, 30 Dec 2022 05:21:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9263B81C06 for ; Fri, 30 Dec 2022 13:21:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE49DC433EF; Fri, 30 Dec 2022 13:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672406495; bh=LqE9lGO8Ffb2OElWi6b389XL0OH0I74Q2AQefVosmI0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=THS0fZnVtjfLfCQHzNCAc6pECMpuUj89rW0AM2Z/cFZfM9e1uAoot+UF/PuK3pjDy 5mN3bRt701/lD9nlTfxgBxQ8qdlUEpZTvs+sf4B83iiJOSBXesDac4Po1xGS5Knw4a CqohHqsBoCTPzufJvXaqJoujUbmwmBamvSjLR0dU7hDJx9z+AGpI0m2d8CgzUsYm9h GXIPeMGPCKitFCgifTpp3+KdDHWl0QyPn/TfhyNyTQYIysecm7O36Rn54g2JlSKH9w X8jBHpRrO8mWKSB4gQenha65v6lFBzkt9IkmcDd9AqmSIHx6xeQBZ0AUp0PkkRq3YI 5WceaFQRtxyyw== Date: Fri, 30 Dec 2022 14:21:32 +0100 From: Frederic Weisbecker To: Marcelo Tosatti Cc: atomlin@atomlin.com, cl@linux.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 v12 2/6] mm/vmstat: Use vmstat_dirty to track CPU-specific vmstat discrepancies Message-ID: <20221230132132.GA186035@lothringen> References: <20221227121137.102497574@redhat.com> <20221227121341.981235373@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221227121341.981235373@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Tue, Dec 27, 2022 at 09:11:39AM -0300, Marcelo Tosatti wrote: > @@ -606,6 +608,7 @@ static inline void mod_zone_state(struct > > if (z) > zone_page_state_add(z, zone, item); > + vmstat_mark_dirty(); > } > > void mod_zone_page_state(struct zone *zone, enum zone_stat_item item, > @@ -674,6 +677,7 @@ static inline void mod_node_state(struct > > if (z) > node_page_state_add(z, pgdat, item); > + vmstat_mark_dirty(); Looking at this further, about the two above chunks, there is a risk to mark the wrong CPU dirty because those functions are preemptible and rely on this_cpu_cmpxchg() to deal with preemption. Thanks.