Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5520156pxv; Wed, 28 Jul 2021 12:45:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOo8KUv24vS1pMC59UygX4zNqh3I2nBHK3s5wQ/wtInE6NV13zJxoY6uImlhMJ46ciG+yj X-Received: by 2002:a17:906:45b:: with SMTP id e27mr1004621eja.375.1627501511494; Wed, 28 Jul 2021 12:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627501511; cv=none; d=google.com; s=arc-20160816; b=dxj18FD1JEYiVukDwqfZRiAq62VciOPdf2EgwDf+9B7wbZ0gmeemkrrEjLo72DL+KI EIBUO9NJK61hPwiy+p8CnP5bjg4NK3Pu8nsq5l+3eKxYe36UF89/oXg/gQEcvJh7vXqz VDlhD/QXLcUOeBM9Zd5qY79TEKBrTS4AvLMKh3Ni1UC2huWpNUK8fbVwON6ldsTkyc0m lIzZJeF6IHUxar9ANmUyQ2YLVhiiu9I2FnESN4Wj7Obk619I8e/V39TcmQWUDnme92tF QjQdC0JsJMH2+KUNwZKcE78jCSRztct9PQFy6ReWOA4bIrh2M+lA5wJmFXEoycpL05T8 mbrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=TgcJqwLoPTRv4fk6gzrVlBugar75L/QJwtcHNSkMUJM=; b=S6GB2iEo0ZoAhkyDOjXtKH1Qd+jY9y0Skat0FcrV20Y+peulDOdojSVOvZ0P/SVokW 272NkKSD8PTjeBsP6o6iJRymMnSP84NxvENRvbIAdlts2tHN8BMcS6Z2B48P1XXkd/fX 7Hyk7Oji+mgpSEblw3joRQ/GHZ83/rLQ+C9Yg+roMNzlHfkQe5qIhRPtGvtiImTFYrJR QZUV7v5nQSmJuDGlFBCHMMjApLIFcr+Bbz5nhZvcAiBb5DqO40MAxL6S8/w5Ee6FTBsI H1Llf8lMTY6akX0TY91sy61rAe/Snp9232l0hNCgEOGMYl03QgEKyzaHIMfMzM9AKIcR jL4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=tjfRiQvZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci4si591169ejc.618.2021.07.28.12.44.48; Wed, 28 Jul 2021 12:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=tjfRiQvZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbhG1Tnc (ORCPT + 99 others); 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()?