Message ID | 20250103015020.78547-10-inwardvessel@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 873B9E77188 for <linux-mm@archiver.kernel.org>; Fri, 3 Jan 2025 01:50:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B09D6B0098; Thu, 2 Jan 2025 20:50:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09B706B009A; Thu, 2 Jan 2025 20:50:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE4BC6B009B; Thu, 2 Jan 2025 20:50:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BDB146B0098 for <linux-mm@kvack.org>; Thu, 2 Jan 2025 20:50:46 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 78B78A037F for <linux-mm@kvack.org>; Fri, 3 Jan 2025 01:50:46 +0000 (UTC) X-FDA: 82964459676.06.FA5F63D Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf04.hostedemail.com (Postfix) with ESMTP id D415A40009 for <linux-mm@kvack.org>; Fri, 3 Jan 2025 01:49:51 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HtviQq5x; spf=pass (imf04.hostedemail.com: domain of inwardvessel@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=inwardvessel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735869010; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZpckZ+t0825F6IGB976GW0oaJ6tqis13qibxlRS1UMw=; b=zwFGLtl9Us2lfMDmCSlrROKrik83zbUbXOpIVcGbhbl3xVsE9DRzUAfWQMdbl2f3Q94Bni HWhgGTHNI1hpW7qYQNSaa/35TB+CYAybnOyGQRSC9P/r70ICrBP1Ta38BxqTBJ3COiB3Ju K5r9Ecu3DLgl1Wj9YjpHuw8GLA3A7h8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735869010; a=rsa-sha256; cv=none; b=k8UOFeGmtvutoHCAsJUCn68hbpHs38n4f2RcChsvrkmXbaLAfcAaibfYh/9GO9Oj7K48YY Smu1WR8iqXV2mwv2IOFykigby9G8Ktt7kLt4xePCvxaPQuQt/WLL9HTKCSF7QJzHGQ3qCp aBuiAyEhAlEl543+1SkZxTUFPic4Me0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HtviQq5x; spf=pass (imf04.hostedemail.com: domain of inwardvessel@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=inwardvessel@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2166360285dso163859575ad.1 for <linux-mm@kvack.org>; Thu, 02 Jan 2025 17:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735869043; x=1736473843; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZpckZ+t0825F6IGB976GW0oaJ6tqis13qibxlRS1UMw=; b=HtviQq5xBQBeHFTaWwMK5Bxf5G2hpqZgsQ4Su3r7mGyooiWsT9fBm6EyQOaiy4Mbor e5i47/50XEqVgJJdWaKDj/HGqBpxBu3X6Bq8FFgQA6/JtmLnmkZ4RLgn47WZAFl3MXdI qildsX0hFdQ9G5leTU4E8a28LkWyyhNH8GaCqjJyD5fEcXZitkTvERPeWgalb3Or/3HW Yz2pyCci2eZAlv4xr4GaHm3Sj6FMzmFft7PdAv1NTUq5l3m+lZWzM6GLmG/cUQvMYQbH +5RMe/BVHiKjFrRh0fPonkjs64EcXy86NPVpSWSBr1l4UFgCXAYcpOiPU3KdMvJMNqWD jU5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735869043; x=1736473843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZpckZ+t0825F6IGB976GW0oaJ6tqis13qibxlRS1UMw=; b=IMYNM1ZgQrRJ6J9xHXWeLtPX3NMk3Op8Evyyo/TpSGZ0avhNNZHQdSRtaukU7P9UeW XAFU8RcIliSXj3ZVloV+l9SGboFh1xfFIp92umXPQpqpXZFun1jjSAqJgfzciAwB8a+d yfveLH2jG/5yH2lzmIAIA3o3LzNenWYoQ4ueybYeVo09WNLbnvu+zSkuXzlpNGCHV900 31hl5WkaX6qvOEwH4Fpt9k5IhlD38H/R5/0j8gPWJrX4pIldf622/8ILsNAw7xZbthdv fUeezYVXIr4KT/4E8vNjfI0HVYaRTDbuy3eA9NVF75tfa9JUBLCXom4NFifI7JZAeRNl VGKQ== X-Gm-Message-State: AOJu0Ywo+QAG0mdsZV4ncNpvcJJ8arjia2XVHG/Ss30m/AObUn+287hT BwtzJ3yMQ4JSJr8ZUQGL7gZn+PxTUm82bsLwf/06pJmFuKz/wnsa X-Gm-Gg: ASbGncsse4Oi7wqfR1yIZkY8cFYwF5GwEQn8FFu+47HJxw0i6tnqGj9fkfIUbXyzFrU IbvNYzf3sr8thZYVNh9BOyPe9DSGul2J8rMbKkhh7klEp9p4NUNP4G457M5jncbRRU2juxna+1d V7mOleifGVLqzmvIyW8QRZQzT/rXFQ+QRWeH2jgzeFvT1Wy1Y7aBV+xk5wAUAdosj1oIj3EYP+b aC7/1IdRtHtfrg3XxFFgvqDI0Agko7pdOoXqGG8Phlv/yAyKR0bMn8S6vrCbXjTleQgICrmt+J7 SWhH1z6rBVU1mhxZ+g== X-Google-Smtp-Source: AGHT+IFdazoj6fte8hxpaNLnC8unSV/ywRTEJ0Kh0HqeY1Q7I7MuHrhSeeZdyfL7DZejliHH6GwWqA== X-Received: by 2002:a17:902:c947:b0:20c:9821:6998 with SMTP id d9443c01a7336-219e6e858b4mr607012025ad.10.1735869043451; Thu, 02 Jan 2025 17:50:43 -0800 (PST) Received: from saturn.. (c-67-188-127-15.hsd1.ca.comcast.net. [67.188.127.15]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dca04ce7sm228851505ad.283.2025.01.02.17.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 17:50:42 -0800 (PST) From: JP Kobryn <inwardvessel@gmail.com> To: shakeel.butt@linux.dev, tj@kernel.org, mhocko@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, cgroups@vger.kernel.org Subject: [RFC PATCH 9/9 v2] cgroup: avoid allocating rstat when flush func not present Date: Thu, 2 Jan 2025 17:50:20 -0800 Message-ID: <20250103015020.78547-10-inwardvessel@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250103015020.78547-1-inwardvessel@gmail.com> References: <20250103015020.78547-1-inwardvessel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D415A40009 X-Stat-Signature: krj38xt7f69hmr8zxqrzju38djy7hyua X-Rspam-User: X-HE-Tag: 1735868991-355137 X-HE-Meta: U2FsdGVk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X/2Q03cqIWDAO3yBYjNtJjwlo5uczLlbEwvEYv9aINpLIkgIXtNDHR+zhwiuBSL7rckKOTSrc48CrIcUDEPMzuPe1D4UtjOOybEcyI4Y+SMmzDKCruJ6zxy2v1alj368yLmBG+e4DaUi5NUEfpuH7sJ1Y4cz6bOz02dqNcekwPgluuYb0gj17K3VXc6M3mPKJSP2BwMnrQDm4Yz10dO7e5+zHnKacs424nNtbbstRRqPZNjRqGhXAag6j8ynKVWACv/NRdxDcWAnryldH/mZbEDQCKPqsNMg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
cgroup: separate per-subsystem rstat trees
|
expand
|
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index 03effaaf09a4..4feefa37fa46 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -423,6 +423,9 @@ int cgroup_rstat_init(struct cgroup_subsys_state *css) { int cpu; + if (css->ss && !css->ss->css_rstat_flush) + return 0; + /* the root cgrp css has rstat_cpu preallocated */ if (!css->rstat_cpu) { css->rstat_cpu = alloc_percpu(struct cgroup_rstat_cpu); @@ -445,6 +448,9 @@ void cgroup_rstat_exit(struct cgroup_subsys_state *css) { int cpu; + if (css->ss && !css->ss->css_rstat_flush) + return; + cgroup_rstat_flush(css); /* sanity check */
If a given subsystem is not the base type and does not have a flush func, do not perform any rstat allocation. Signed-off-by: JP Kobryn <inwardvessel@gmail.com> --- kernel/cgroup/rstat.c | 6 ++++++ 1 file changed, 6 insertions(+)