Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp862861rdb; Fri, 26 Jan 2024 13:07:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEVh1o9galg4lozhtxuocTbXkuYY4Vz64ivk/bAtaevtjwKp+qyuYuwBoXS/HkcZn9mXJx X-Received: by 2002:a05:6a20:4984:b0:19a:3cf1:7ca8 with SMTP id fs4-20020a056a20498400b0019a3cf17ca8mr269684pzb.98.1706303270274; Fri, 26 Jan 2024 13:07:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706303270; cv=pass; d=google.com; s=arc-20160816; b=h5L0QUoCT0/9VI0iO3eJyOF+qgwe9/6BHF6dfkZHc63O9EsdgiKmVMW5p0SeqU5E+6 HkagV5A/2gNme9FiRYPagteOK1IDojkZFQXJX2/2ZAejG5cGAGsNpCp7zgc7cohghW+A D2TVbtGye5Uy5I9iuY48AiOuQkUTrKG7vbnmkg03y1ClSUnBKfsJ0pBsTpccS5qTsma2 As/H2BtFR4A5GlKpV/UJiDv5QM7RL0EOtcMVeoQL815kSwuZ7dce7elzztwCGVtAzg53 /U0pakqFdawidLU3QDltmCImBSWut1OeZgU8d18PNPpFrdDbw5guSI+AM5GnygXTWMNB sXRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rXLiZ/QkDFCOQ1THZJEDxzG3f4B+MGCbqeorNkMEFUA=; fh=2+07Oi8O0v2e8PUFu5YIBUlG8RjGn6CkQ1yUXLlBw7o=; b=jtTLQ8PQPTT0t/ckdCHPu8iLFhImKyeu1bjcEql5CKRrIMToBURFE5ept/I8pWvcPr T0ZxFv2GjnRFOJXF6tgksI0pqBtMUMWJyiX4hgLBAfHqwnpfWUaUIaPK94NDwi06sY/M eSLaUO5FlE9dpyHdE2l+qDUGeNwxpDh2ttAZHxe/bHgBcyQ1AMYbbtRkuLL5FWKWkeEa BGTNpnwvPyCQbOAwDRctzo/EB66jOywOJ21CE3PY+JAPqOXSLKYgbCKkoKchpwtoZQY/ clLNVlwXk+gGK1/eWumQ9fY72uuyG2JEvhR5L2CgkB3F59VrFEifIqnY1da7VlDN6pen JjLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=2aqdI02e; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-40650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k30-20020a63ba1e000000b005cecafd3c43si1693283pgf.218.2024.01.26.13.07.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:07:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=2aqdI02e; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-40650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org 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 D2020B223BA for ; Fri, 26 Jan 2024 21:07:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D942324212; Fri, 26 Jan 2024 21:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="2aqdI02e" Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 AE2C6249E7 for ; Fri, 26 Jan 2024 21:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706303206; cv=none; b=vDlRkyU+ITyNtqM5jsTyrVxfUOkWAoZo0hgFCvCJ30Z5ru21u3mU8ulB1HljQ8zS89O3sQ2DZhl6e8hKmq0KH9ldiob38E8cscgU5ZgGnKtU41IMglntasTmrNBKBmSCJRyEXU2iYmqZS51bYuegukaK1eZtpd8DXwpTz2hiemg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706303206; c=relaxed/simple; bh=DGuwcy7+t/oybW2DmRtk136XOg5k5hZpx3k/FLEeh1M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g28Y0ewSCQZQYh85KdFcGcpkSYl/ABLqQ8AOVYT1wf7j5PAV+ZZni5L61TG+5XcuOV6BrMnGvTp32CAvymeYnn+P5crzIRRMDsosUC+f/9nXJlXlSzlu8Wfg2UO1ABdgzGVxyJCkqkqanxJTASrDdQgqEVciBm2jzqhUzYRFBik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=2aqdI02e; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6e114e247a2so169210a34.0 for ; Fri, 26 Jan 2024 13:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1706303203; x=1706908003; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rXLiZ/QkDFCOQ1THZJEDxzG3f4B+MGCbqeorNkMEFUA=; b=2aqdI02eCc3PAWaJMav8f9c/rFa8OVjTFDJqbPS/mqzDox6ndcHxA8J/LEXaO7bO1q aB1bSWDT9WTUmHhyfNXbCt9U9kIOqijHgj5ErOkhCOybPFTFyB4rPeM0LspqlqzfheUC A7jMv+l4orynVg9o8DE0MVg90DnS7NLlqNWst7zuiTzEDT3WtjLaJyE8NhKzeiDX7gYO Q/0GNkqj+y6LIfiCbd+sSIq9dRKLxjoMIgRixRGN+djGH+2b7ZQXnOmLjRSs8pfXlKB+ 9MEyM3xxaExOAf4EuUXqzr1g4TLGOKPEFJXArKLcgV2U9t6N9Qq5NgmyWYT5V8HA6FGp ZVSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303203; x=1706908003; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rXLiZ/QkDFCOQ1THZJEDxzG3f4B+MGCbqeorNkMEFUA=; b=tAqaJWln5AZ5GOk8tgJGC3U+BRoNtDHlKD9S0KaqKvl93SYr2JeezsQiZ9HqU2IkcL gn0we6b5/Jsc6ROixqGj4pCUgW9pvyEsHz9QraNsVLb3V4daksskjGDDIZnEoPUZhxxG BdMKqH8P9uBA913RFbAvz0wQeMhz3FFJX1F7YMUbsZY8RpX2TRqhRLTC2cFibjU9ZG8z e3iD05GUBMXqTZzmf/1q8DJbGi12OmVbZIRla/dBT9aj6D7EAWkir9Y+il7EvEv86HTz aZLBakqbdqc0aXoDVNt9im59a7ohnv9i59iJ2lle8xMh0fVYqIX7XFBtF5BtWxoFXxtm uoyQ== X-Gm-Message-State: AOJu0YwvdFt1ZBkXGTwx8LGB+dmrqCkfPYMwZn5qM3+SqJOYDLu+nnSp SLbSZzo966oiL0ZzKluTyUnNrpEw2JxYjgSFFOG8rOWpD0XAYsve7Kb5Tu0CILE= X-Received: by 2002:a9d:4d92:0:b0:6dc:776:2eb7 with SMTP id u18-20020a9d4d92000000b006dc07762eb7mr282095otk.60.1706303203640; Fri, 26 Jan 2024 13:06:43 -0800 (PST) Received: from localhost ([2620:10d:c091:400::5:271e]) by smtp.gmail.com with ESMTPSA id nc6-20020a0562142dc600b00685ad9090basm830074qvb.97.2024.01.26.13.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:06:43 -0800 (PST) Date: Fri, 26 Jan 2024 16:06:42 -0500 From: Johannes Weiner To: "T.J. Mercier" Cc: 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 Subject: Re: [PATCH] mm: memcg: Don't periodically flush stats when memcg is disabled Message-ID: <20240126210642.GK1567330@cmpxchg.org> References: <20240126203353.1163059-1-tjmercier@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240126203353.1163059-1-tjmercier@google.com> On Fri, Jan 26, 2024 at 08:33:52PM +0000, 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 [1] added in [2], but the > periodic flushing started in mem_cgroup_css_online is not. Skip it. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/memcontrol.c?h=v6.8-rc1#n753 > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7d7ef0a4686abe43cd76a141b340a348f45ecdf2 > > Fixes: aa48e47e3906 ("memcg: infrastructure to flush memcg stats") > Reported-by: Minchan Kim > Signed-off-by: T.J. Mercier With what Shakeel pointed out resolved: Acked-by: Johannes Weiner