Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp621665rdb; Mon, 29 Jan 2024 12:36:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9XvXiFOgvrlM2MbqYJj12erFqC/S7oIyFp22MrOLJGLvBM020WcgJqYA8teOqDiaei85p X-Received: by 2002:a17:903:32cc:b0:1d8:e79a:ecf7 with SMTP id i12-20020a17090332cc00b001d8e79aecf7mr2104575plr.46.1706560580998; Mon, 29 Jan 2024 12:36:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706560580; cv=pass; d=google.com; s=arc-20160816; b=jhP3jxizTlf38wb8yu2EXmLImyTIDPdD8r9iX/yQkdpSg58ETcCmk+fdqC7eru7pu5 wn+9AMMK4GqjfaS/wu4E1kdZXKSn3QxteSWROrk+qHHblAVDKkXCzpCx7mCjwUMxNJTT c21kaIScx5YKaG6q4RnH2gupsj7fKhK42md5TKXhmBkosSwhjcoIQuXc2i7a8VSAVmVV ZsAMuRqfU3N0S9HoBPjx0FAi0UZaHQZ3ghS1qTvbzF4GsvpDsuFJNGArD6+58jxswMZq otm8mAvOSXePt0sckjAqHTzfaNYQkKxM0M3OlfYESdr44huY9j5AQa+9VupnbXNHIALZ Ae1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pJ4yjaXnu/gO8IJm2MvBxAL0/BI+WbXyDMVS9W9Dbmo=; fh=/3sWLLrKCwzT22jneZTUYCDKOTsTp8mVFg/XjL6ygfk=; b=TySjdmtg6+MOLaeCv0QHLKzCwR3TVOelKU9BtBdTirMfm1equVi1BaliRFVHFEjRnt syJUARhYQc4HzuOYmBQ4vXcbRcJsrSgz8ciS6fNVLlO5CTB9yoh9hd9WnFdKWmvckwGm 9wpHqN81QBVQeZjS2GZ7daj/LP+ROU5irXuBcHv9nrDfhprb6Oi6cr9MS9CSL4uHNent qY9xmEsylSyB/uOgzsA2rWfgI13YAIJp6WLHF3ZOkVNCV8FQbRK6RsmrHt0km5ixS7ee TI1OvyRvLdCVJOYi5VHOSotUtJv+bVbAxzBc5vnHTKrPXqds0pFJQLgzggsGZ+ed4fwg ME+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="gB3wk/P9"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-43475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j12-20020a17090276cc00b001d8ceaa1a4csi2987187plt.427.2024.01.29.12.36.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 12:36:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="gB3wk/P9"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-43475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BFED5B2601F for ; Mon, 29 Jan 2024 20:33:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14EFC1534EB; Mon, 29 Jan 2024 20:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gB3wk/P9" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99852241E9 for ; Mon, 29 Jan 2024 20:33:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560407; cv=none; b=DAhqpJQm4Ptv7Y01HARG0/up6QJ5WES5nGMDJW+nuV8osUwHACfcTWe6Gd8yOvDxwFwzCl5ed9rcqX8yOrQn2b2qA+1/+lTQ0fNOiQPklsQjiywKMbgGvQf+JGw/3KjDSMlTjIYTSbg0FjTqrGVAu9rN9s1MbYtgTrVCCHy4nCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560407; c=relaxed/simple; bh=pJ4yjaXnu/gO8IJm2MvBxAL0/BI+WbXyDMVS9W9Dbmo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KHBohnyQjJIT5qANjrjCQtXT5UfInDOkVePHL5buawa82MxNd5wsze5yNKy+0MYWe6Ki7j56NRlksBNG5IhAgNvbwzbeznHKrB9jiGva2UHeJfmO6AaZZ4Hbc1m6h9lO1oUfDmQqNIAaT/Mbe+J5x4ep5wCSFr2AkdO1ejmmjv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gB3wk/P9; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a293f2280c7so340756866b.1 for ; Mon, 29 Jan 2024 12:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706560404; x=1707165204; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pJ4yjaXnu/gO8IJm2MvBxAL0/BI+WbXyDMVS9W9Dbmo=; b=gB3wk/P9wEUtpU8znzFN2zXCvGauNRQfwSvBqOsn7B/pCMM9Y8W96Zhzf5j48YpLBT F1nQ+FmH5+7u+OBDoAZL4M8kkU29fmfO7RmtTaDzI6eIB40hKrRFd7xVMUB751FQstzd VAFfDXaj+WJbcXCnl4IJL8P1WzS4HrQhHjKgbfF/pffpltSpJ+ESoMbS6RLnFzEt2Fqg PEHxa2nv5q1BPqcyOOVnBbqWfm5To8nSQcLjI5wvA51NWFiOS3MTy9i0p0EVCsy/1hJY MpBsADfVwTvGRycABRBlhlR/hrJFGbPNmCHAywCjfcvNwu3b+Nguw8fsyq7/loqRL3gV zheA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706560404; x=1707165204; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pJ4yjaXnu/gO8IJm2MvBxAL0/BI+WbXyDMVS9W9Dbmo=; b=lM6eFkdBu2m919+REuZrq1vLAKZquLbuzzlpYw4BbX8p2ASn9JzGQH/uNZ66vMKd/k 1KrWVRxvvLVKdxjv0JWz9DhWBJe/PrfXNUQQnCYTjPBPKNCU5R7G9PVjXHUvL4oVvf4c nlDR0GoljLMHozpkakIyu8QcqwHxmYQm7Gs/EpnCnyAJwOq7Qe2pmYjebKFGEU6jLaZV lQrrhw2rXpAkM3Yuk/NDpx/zZMAj+tNzP4dwXDExZQJHK/n5Myd6LydMQHDPhGcnfdrq v2RGaD4hzjXmB4V9QGj/WzumhcS6YaUYdtS7NKumCZNiE5JXxJjhwbFQdN9MC9k4h1j0 8pBg== X-Gm-Message-State: AOJu0YyUbDo7ksUpwjTDS1W3hvOcguAjFjZkiKi0AXPWdrmrI910vnZI 2ENoLSnLx00nFIifqDNSYw9tbylzMM0Wg23oYXtDIEp2R1qs3vSOG3jpIvHpQcOAaelnof/inu9 1ffDDH8cNyZDECOXIPfzQVmrYoGG02HQToOPW X-Received: by 2002:a17:906:4ac6:b0:a35:2c1c:52ef with SMTP id u6-20020a1709064ac600b00a352c1c52efmr4959461ejt.15.1706560403622; Mon, 29 Jan 2024 12:33:23 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126211927.1171338-1-tjmercier@google.com> In-Reply-To: <20240126211927.1171338-1-tjmercier@google.com> From: Yosry Ahmed Date: Mon, 29 Jan 2024 12:32:45 -0800 Message-ID: Subject: Re: [PATCH v2] mm: memcg: Don't periodically flush stats when memcg is disabled To: "T.J. Mercier" Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , android-mm@google.com, Minchan Kim , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 1:19=E2=80=AFPM T.J. Mercier = wrote: > > The root memcg is onlined even when memcg is disabled. When it's onlined > a 2 second periodic stat flush is started, but no stat flushing is > required when memcg is disabled because there can be no child memcgs. > Most calls to flush memcg stats are avoided when memcg is disabled as a > result of the mem_cgroup_disabled check added in 7d7ef0a4686a > ("mm: memcg: restore subtree stats flushing"), but the periodic flushing > started in mem_cgroup_css_online is not. Skip it. > > Fixes: aa48e47e3906 ("memcg: infrastructure to flush memcg stats") > Reported-by: Minchan Kim > Signed-off-by: T.J. Mercier > Acked-by: Shakeel Butt > Acked-by: Johannes Weiner Reviewed-by: Yosry Ahmed Thanks!