Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp869275rdb; Fri, 26 Jan 2024 13:23:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuKUGXyt6kt4tgIDYl9rzaU3Lj1f8HFP6MDa/0M1IxV0BfJ8ktj2SI9VLtaq0Upnoh/2Pa X-Received: by 2002:a05:6a20:72a1:b0:199:f335:449c with SMTP id o33-20020a056a2072a100b00199f335449cmr399959pzk.45.1706304210396; Fri, 26 Jan 2024 13:23:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706304210; cv=pass; d=google.com; s=arc-20160816; b=1G3hW9QPvfQGBh9+rPMKeEC9TcwVhr3+WcmOPMrO8Kfb1yUiZ1wE0r57kpUMDRjpX2 7OTCTGjJ52Sdr4PE9zoikElrBsrerAakZVoGF+aX+JwLBIpaADecLpv1VIjPSGartKrr TixRAde3og5PNqYm0HUh5ztJA6jzzJAK8HYVpestVqV1tRtdK0XgYuwxx6RZtqNEwiIU tf2IEIXumLC4CfJmrs6wzYgON4R95/VwL2emhRGeyRodK0SD1SgTKN3hkZGJu0T12bhY N/xDw2rLIzuq3K7e09j0QATHW/2GdOJ+X9OOpBYGQqx8ms7wG8KMwYVkUvFasuRM4+3i 2o5g== 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=jqSQ6/JqtbJ7/Z4GvmSnpd6osmjgOZaJXviYh+bhU2c=; fh=IpD8H+/N7ANkN0wfCBDn4BWsgEcOzpojHdQBb0Hlcr0=; b=binloULeN07rkR0cq7cdW52jlrrZy/+IPi4V56VFz1nw0u5tRmLTbOAfxlbEMNeh6l sU6nJEdfhmdVKZOZcSmO+IEYjFUU9mqGOlNldr4h0B/jZNGWUj7ejD2ndHPguyE6XphH VluH9SUDbVsP5vQi8tl9wGzKFDngpQk+1ScpHQdLNCWIawXO+1fVD56GmAQ+T0UUUytx BM7cmrV0/S3zqk6mA66uqj8ocJqyGW1NuG79Bo/3gNP27hvrRaCzvAj2toGIukyZ3skP kNEsZswDXsPoPuqoxZBI4ptjkzVK0DpgFQCryXiEs4eeQkkSISo6m29lpEtrGUmDQ/T6 M21Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kSbqh9Wd; 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-40666-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40666-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 o7-20020a056a001b4700b006ddc45a7166si1690216pfv.196.2024.01.26.13.23.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:23:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40666-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=kSbqh9Wd; 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-40666-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40666-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 A1EEEB251EE for ; Fri, 26 Jan 2024 21:21:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34BB924A04; Fri, 26 Jan 2024 21:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kSbqh9Wd" Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 EF64B24B24 for ; Fri, 26 Jan 2024 21:21:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304063; cv=none; b=DB035YguoeslzixnkbvlqOz7PeA9qVEn7cISgLRI4/gn2o6jprZjjNB/d0uD8Bn1kSj8FR7ktDidV/U9EkgZlpD73yIsMguVzDV0YprCtznhfZA1vfDEIcMvdi/YqfPWSYpXgIZCx/zg3Wm6w17XIE5i1n1VIz2vfzMRImblN+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304063; c=relaxed/simple; bh=jqSQ6/JqtbJ7/Z4GvmSnpd6osmjgOZaJXviYh+bhU2c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RkVO9J0I7a2WrBYcQwNDgC8f8VuJuLSlEKYpHLbYGt3Y72FFujet9EZNM75wkooUQGz08/z0c19+FZdwKQDMKA6uI/jViaeHCWjIwbZDYOQtO1WwASeCDnH0q7CMyq5CO9HXVWA8oCCBvs4h15XRVO4cgO5tN3ZSirl7VU0eZcE= 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=kSbqh9Wd; arc=none smtp.client-ip=209.85.128.172 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-yw1-f172.google.com with SMTP id 00721157ae682-602a0a45dd6so7447857b3.1 for ; Fri, 26 Jan 2024 13:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706304061; x=1706908861; 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=jqSQ6/JqtbJ7/Z4GvmSnpd6osmjgOZaJXviYh+bhU2c=; b=kSbqh9WdjGyT1UGrfEzwGQc8VI/hk3+HrnAM61tz+aUJq0sRga23uPUefTE6HEtWKB 148wRpWZ0WUpPPee25txZoKouZJYjxeOCLAMJxu/w9cGdsJ+1bNi3FwNoGVoXRh+O3eW 59gZSzYfSa+RfJ2mamEaowm3nJH8zZgsMM9okKNqOEC00MiJoHKrgxrsDC9Brh4aBwvj b9yLQcgu0l8OSdv2ew/IAodBzAgVCC6vc9gLoTk4LPhkecNoNPxSGWecDGyitN6WQbIu AEHdD9Q65kN4R1PE9zZz6kUX6W5L0crbpE2FuN21EnPBsk+Up5vTw0X7w1XKhFzYUwPQ rSfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706304061; x=1706908861; 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=jqSQ6/JqtbJ7/Z4GvmSnpd6osmjgOZaJXviYh+bhU2c=; b=avdQEliS1Zh7l82/FRwArhBS8CuRiXx3kJ2ELIX2ZVV0Cbg7OH3UEnzXJi1e8dxhTh 4vWQDjS/0NBvkq5uGauZWE59hZD99tTFeIC35gdmKUjAm6kKQQxwVLo7+W3CKzQJIVqt j9/+alDSD/pIn7JUnAvwhjRXqrRRx8tZVwyVSUPDN97Hvq+QYtsrkETgc2nV5Q8jQH2C QiySCPCR/j8UpLYDSjJT6d/j+6uGkvrKMR4ylESGKU4qAvOiaT7WVU6JHG7efXaShL5N vRzJ9mCRZ5pxUBJKm2cKwA5uCWJtWDXr6Mxll6C0EFhuMZvdBOIGsh5O0MTSpBBOtUN3 C8og== X-Gm-Message-State: AOJu0YzEj4HvjwgnRaeHfjdqrOOEYrZ66aDuG6hj8EFmm9k5FLvsSYtV 9yLyUEjmznGi0bteFiB0DycdmJyzVFDu4ZxhElD1c3ynmeL/WP6+/WUCxy9fYvYItEI4rx3v1OS GpfDvuAkPEHWYoRNfodZSDoM5aTs0ThW1nKBw X-Received: by 2002:a05:690c:f8d:b0:5eb:3851:2bba with SMTP id df13-20020a05690c0f8d00b005eb38512bbamr522536ywb.41.1706304059761; Fri, 26 Jan 2024 13:20:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126203353.1163059-1-tjmercier@google.com> <20240126210642.GK1567330@cmpxchg.org> In-Reply-To: <20240126210642.GK1567330@cmpxchg.org> From: "T.J. Mercier" Date: Fri, 26 Jan 2024 13:20:48 -0800 Message-ID: Subject: Re: [PATCH] mm: memcg: Don't periodically flush stats when memcg is disabled To: Johannes Weiner 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 1:06=E2=80=AFPM Johannes Weiner wrote: > > 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 online= d > > 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=3Dv6.8-rc1#n753 > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/= commit/?id=3D7d7ef0a4686abe43cd76a141b340a348f45ecdf2 > > > > 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 Thanks Shakeel and Johannes. v2 is here, hopefully fixed up correctly: https://lore.kernel.org/all/20240126211927.1171338-1-tjmercier@google.com/