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=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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 6A493C4320A for ; Wed, 28 Jul 2021 19:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E76661042 for ; Wed, 28 Jul 2021 19:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231414AbhG1Tnc (ORCPT ); Wed, 28 Jul 2021 15:43:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbhG1Tna (ORCPT ); Wed, 28 Jul 2021 15:43:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 928FE61040; Wed, 28 Jul 2021 19:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1627501407; bh=TgcJqwLoPTRv4fk6gzrVlBugar75L/QJwtcHNSkMUJM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tjfRiQvZF1G/igSUwx43shhbBOQEqN091BYafBeKw7pF2opxclayI80Sqozlu7XJb UM7ImzliQbGmesD9ts7CZU10l7Nn6pEJOV9FBYgw6A/Lzk08zEQTwsWjvYFs/umYny HW8XEHdL8aHqj7IE3AUFQcUDSI9vBDL3mUC8rPRo= Date: Wed, 28 Jul 2021 12:43:26 -0700 From: Andrew Morton To: Shakeel Butt Cc: Michal Hocko , Johannes Weiner , Roman Gushchin , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: cleanup racy sum avoidance code Message-Id: <20210728124326.a3e6cc29f670062185fb57d7@linux-foundation.org> In-Reply-To: <20210728012243.3369123-1-shakeelb@google.com> References: <20210728012243.3369123-1-shakeelb@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Jul 2021 18:22:43 -0700 Shakeel Butt wrote: > We used to have per-cpu memcg and lruvec stats and the readers have to > traverse and sum the stats from each cpu. This summing was racy and may > expose transient negative values. So, an explicit check was added to > avoid such scenarios. Now these stats are moved to rstat infrastructure > and are no more per-cpu, so we can remove the fixup for transient > negative values. We can't do anything about the same code in lruvec_page_state_local()?