Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3115208rdb; Fri, 22 Sep 2023 20:32:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2Fd/aQvjbR7sItWgmqJ+uXG/F++mD2lq+BTXdq+ZzLh3LpSSdiH3wvC8M5wQUpUZ0pXny X-Received: by 2002:a17:90a:6341:b0:263:fbe5:2125 with SMTP id v1-20020a17090a634100b00263fbe52125mr1180679pjs.15.1695439959040; Fri, 22 Sep 2023 20:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695439959; cv=none; d=google.com; s=arc-20160816; b=w6i+OvtVu4sMp9N6sta3az6LrFv2Mdu7xAXAy37wu+5EevOURPMojioFQ9v4Q5SuRt VKdH9GNugJitI6Bhw8mPnl8vwNdIoF00060dI3Y8znveqLJlfektVgvxF1fffAdCxFd+ fHG+5SOfUVkskY2o5UeBv0dHYdQv3OuOnmGpP3YbhYkVd7Vlxxo7+1RWsSejBHHwKjL1 wjHz9RmOimM3cxu9onOJvNFsn5NYUbyoed6pAbscQqlZbybqLA8RwOsY1BlofggLEnlh KXBhwCqNFAndMaGwac+2fPdFynxHb5CpHK/8/e3yrZ9NEYg4GdCnylMnw2/xK5ZapTTv V12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=TWhlillKWVcEeVnrDyY8Q3IYayRPjR5OTdgTyF2A4S0=; fh=8R3NybVVYxF3mxyewwJ7cqkhC8pADgA9jxe98eswTvE=; b=oTARJx2OxjUUJ7v2L4zz6flTlj31AETRc6E/obGZCUR+oBKiDB2kqESAkay/qmIAbc 1Wt+Mq1zR2GllM8WNK/QcMnYbcEwsI7Ci6Ko15PsQkTfA2iuSkguJAhkroICGVQWhaeS BSrx8HqGp/xBuPkL7bwlFiOw+MppvL8amlvUVKSltL9IT4CYSYMttPSP484dlUfGgT9b ESI8XwG++lS3/rOTWpI4VhsOHhm9gAXJepLhQ/axIbe+1oQlGojmTrxJ16wFD6owjXOb Mr29LumX5XfDDmBVygEbd5MOCnfMg9cmJbyC49A9Kd9MdWuCgjqu/jPPNGl7hVaqdIUj 7koA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="KF/mZ9HK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id mi18-20020a17090b4b5200b00274c70feb29si321644pjb.162.2023.09.22.20.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 20:32:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="KF/mZ9HK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 775528373824; Fri, 22 Sep 2023 11:00:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234360AbjIVSAM (ORCPT + 99 others); Fri, 22 Sep 2023 14:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbjIVR7e (ORCPT ); Fri, 22 Sep 2023 13:59:34 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EAF04207 for ; Fri, 22 Sep 2023 10:57:44 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-59e8ebc0376so35163397b3.2 for ; Fri, 22 Sep 2023 10:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695405463; x=1696010263; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=TWhlillKWVcEeVnrDyY8Q3IYayRPjR5OTdgTyF2A4S0=; b=KF/mZ9HKfn/WA0ZSf/lvAI/cCURUB5ub3z+0/CTXUMMlv+Tym0E4kqnaDycqPdIVzb Kzg/IyiwSilA9xiMNMXhEaf+Kti6bcrddodaJbrRYcALEiKJ3xPGVRNUoqKJYPL4sYe+ 8Wtdixfgwt4qHlbh6c/3jWY/1I7VWb1ERxPLo1zWs9CbxsCjzms5SodHdiLP7iVmDfTa 0AC4QxCBiILwumu7weq3dLnxncip3+YMFKTLF7xZWLTjX+ENJzxRzUeuh63VRg5/Ei0Q lc/zIx8N+5pNxfFH2zacDEz/Ckqwji3fKULiTVnh46f5a0yC9ObEn6wTgdjff5datgEt mGJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695405463; x=1696010263; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TWhlillKWVcEeVnrDyY8Q3IYayRPjR5OTdgTyF2A4S0=; b=KWfyXwKxv8BCNWacxQT9OZemLEoy+OpP31wqvfnb0NUbhTf8328/DwdXF7r2sy0bvw m6DRQZ7WIH3LANdoJxFJer4SdeJIggomn2gAF6Vxf2dU4NBf4F8CV//QgZND8kOByGb0 U9GF5F20UgIRe7Ma9WECAfy6VHSXXEr/rvjfr22+RUJTvk4pJsG7yVZGb16BDU3jMJFE 39aG648kz8CZXWRtz1Q+iVmTPrZVGRNi7mDQ9JHOmNW2wD3MMKvD9yH97XwLhIGZztWY i4DykrjnI9oQwf/6pAWUbEijstcYlPxvyoePVhHqe72a5ZE5qckQQdPYCXssv7C48ut9 sFpw== X-Gm-Message-State: AOJu0YwfJIiFCYxtxsHuXzFGQuFw4H6Pr4sn1pwQSxkoPgH2ZN/MmWAa p21N5123bFZp2O+yTb6xvpYfCYUwInJCeADh X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a0d:ec49:0:b0:59b:d857:8317 with SMTP id r9-20020a0dec49000000b0059bd8578317mr6978ywn.2.1695405463484; Fri, 22 Sep 2023 10:57:43 -0700 (PDT) Date: Fri, 22 Sep 2023 17:57:38 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog Message-ID: <20230922175741.635002-1-yosryahmed@google.com> Subject: [PATCH v2 0/2] mm: memcg: fix tracking of pending stats updates values From: Yosry Ahmed To: Andrew Morton , Shakeel Butt Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , "=?UTF-8?q?Michal=20Koutn=C3=BD?=" , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 11:00:22 -0700 (PDT) While working on adjacent code [1], I realized that the values passed into memcg_rstat_updated() to keep track of the magnitude of pending updates is consistent. It is mostly in pages, but sometimes it can be in bytes or KBs. Fix that. Patch 1 reworks memcg_page_state_unit() so that we can reuse it in patch 2 to check and normalize the units of state updates. [1]https://lore.kernel.org/lkml/20230921081057.3440885-1-yosryahmed@google.com/ v1 -> v2: - Rebased on top of mm-unstable. Yosry Ahmed (2): mm: memcg: refactor page state unit helpers mm: memcg: normalize the value passed into memcg_rstat_updated() mm/memcontrol.c | 64 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 13 deletions(-) -- 2.42.0.515.g380fc7ccd1-goog