From patchwork Mon Sep 9 16:32:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Koutn=C3=BD?= X-Patchwork-Id: 13797304 Return-Path: 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 C5FFDECE579 for ; Mon, 9 Sep 2024 16:32:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2259A6B00C3; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 138BC6B0191; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA6A16B00C3; Mon, 9 Sep 2024 12:32:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C6C966B00C5 for ; Mon, 9 Sep 2024 12:32:29 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 78F2FC0BBA for ; Mon, 9 Sep 2024 16:32:29 +0000 (UTC) X-FDA: 82545742818.21.994941C Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf23.hostedemail.com (Postfix) with ESMTP id 8BD8814000C for ; Mon, 9 Sep 2024 16:32:27 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=Hx7X9O5d; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf23.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mkoutny@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725899434; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qcEdQE9kkUNRmd1oSgPgT8tBtd/F56AnD10peYUx9eU=; b=0kMsVZ6cBTXZ419p6hpoQy0iWsFpdmFhur0WVi28ZXrc0LnTIdWmUYLf7YdF2RyIwLofQh o6rtCkfD/FfY6zFMvj+h4TGop2L6EIIBOhYoLMnfW2aR7g3AOtbzfnfjjDI0lQ7QbI3vuZ jxcSZdNqGXBzkswX0WGwETVNOaVi0Uc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725899434; a=rsa-sha256; cv=none; b=PS6SfvmcqxGEoVslDthrHLtrj2c9GDNhNKYsc67o8g0MJcoUoa2Du70MNnSiv87lA7jvV7 +YptA8WU8U2T6uqcRDoV68vF0HMVe+PKqWuCu1f9LVq5O6+hLufb5Fi0gXIJRhRnsOvWqK OfJiokkQiLrsjmVPxCem9fkQxPQnZwI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=Hx7X9O5d; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf23.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mkoutny@suse.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cb9a0c300so8495265e9.0 for ; Mon, 09 Sep 2024 09:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725899546; x=1726504346; 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=qcEdQE9kkUNRmd1oSgPgT8tBtd/F56AnD10peYUx9eU=; b=Hx7X9O5dq+udVtzDwCOqaPG793V7sZZYUn7wtch3PkGiwOjREAOTXyJ8BFuSBf8xXq SI4wwOhbT4H1pZCfjxrBnASKGhAyRvNIWll61O/V747yTSGUe0pbN1xnUN9mHadirg4T 7Vi50w+wZ1VwhQCQPEs00nYB41nAvGlAQI0nUXFSCGjRcJV4vPhN2EhXnvkhK8FjAqNS jacxLMJtYcK4RjTBTzoB4RJKQU93TiYIZ4tfJO7SH1zVdER16xtSExcLD2q/fNBd6SZR icvqw8oWZhQGczBk6M/ktWnMHO20htIvdfWGE71HrgBGRI/g8ZH9+/w2aMS+p8Xa1YwH OLWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725899546; x=1726504346; 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=qcEdQE9kkUNRmd1oSgPgT8tBtd/F56AnD10peYUx9eU=; b=tuNgRtjGvbv5xpWv19wdcchEUzk8CLk6uzHBu65Dll39/0ZaTHhCZArUxlVXYIC+ZA SNhUBV5yD2lYXx0jEVO0PTfJFHXC2nKC8dgdDQ6wizDzUXhSr52hOiMfb6LHZcNRB35i 8lw5L8bxxrqH74iUo9l+B8vqH3YK9OGen14BTShUf8OFWedDqlDRcOZJNtHGh7ZW3DR7 2UUDD8f0QISZehQ0BlkE/V0Gu1B0oPGPWIef1WIavsLlQOQ6nB3VtTEFi7H1aethboHk zWb5if3CkJMW0ac286sc29LaNw504E5+koeyWg2dA76FBrXSq3XsqQW5IV3/jgDlYr25 s7fA== X-Forwarded-Encrypted: i=1; AJvYcCU1vsP6RhQzwukJMyuoyRtznmMVyKoeEe+m7Rfr5q7ar1creTU3ckTgOe6jVfGBSIHtNGOczlH29Q==@kvack.org X-Gm-Message-State: AOJu0YzGFImpix851aZ8rjpqeP37eIJ0ZDVhjG4dPdMwgKG0dFJYpNsW cX3U1CeuMuBlIK02E+1jVLw5ri2qkYsY8wfs1tjXscyGeBxMlvewWei/drXCqdU= X-Google-Smtp-Source: AGHT+IFYKssoeiQ8071s5mgXvgeKUkJPqXfUO0b5wcMLkjdGWzc7MF/UiF8wCm6ppGL882KotfQOTg== X-Received: by 2002:a05:600c:1c81:b0:42c:bbd5:af70 with SMTP id 5b1f17b1804b1-42cbbd5b273mr10759625e9.30.1725899545970; Mon, 09 Sep 2024 09:32:25 -0700 (PDT) Received: from blackdock.suse.cz ([193.86.92.181]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3789564a072sm6478606f8f.2.2024.09.09.09.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 09:32:25 -0700 (PDT) From: =?utf-8?q?Michal_Koutn=C3=BD?= To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Zefan Li , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Chen Ridong Subject: [PATCH 1/4] memcg: Cleanup with !CONFIG_MEMCG_V1 Date: Mon, 9 Sep 2024 18:32:20 +0200 Message-ID: <20240909163223.3693529-2-mkoutny@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240909163223.3693529-1-mkoutny@suse.com> References: <20240909163223.3693529-1-mkoutny@suse.com> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8BD8814000C X-Stat-Signature: fngu9ah47sc7xdwtcr3q3ij7dxffp8uf X-Rspam-User: X-HE-Tag: 1725899547-660057 X-HE-Meta: U2FsdGVkX1/8WdcRlQ4fu5BI5t9v5knzxv6lcOOyvra7Di23ufY9kRjEz0dcLNOtPKsIte3duLl7uHgwy+VFRJIzRO+JXJ/jXrVc7mFZa8hWmVEerIFUX7TM3PgvIJr136p5VSxhr4czV9SE6atJe52Vz9jg5xe2rj1LrMWEinXHohEemqHCOVLL1WE98huxilQe34fpQfdVrRhc9/4J+wA/LlP2SSM4Nh2BBbX6XR+cYQxGsD1dWd/P82vASDAaLq5Xp6PLyAYv58U7C+7+FDEgfCoDJ7smlqJ6MUIFTRAOVFk3ZIY2S9l2aGnD0fBy/HVgO0NKB1TLH56zGUPbg6Y9pikUba06qwq0xOAZTg5+rhYK6trRru1ODQj0x17OMSvzCAsxi9p41mKzp4mlNWxOU/Hip8X0skqIWT6mNR10Nt/uiJ0Wqflu0qFoYSNHrPuxHv3WwkoS08iIRYjCrFsj70oVdr1pWUiL5QmDIaYGWQeWv/xLRcGlK9AtbE3rOilcOPR2VvKc0YubH341I6XvqAwap5stcMlmLaUlt+t+UcWQjUcMdVBxkcr9bJ9zzcp9a7FiKJ0NRXoKNWsLhtewwvdOW7f37i4Ptp1RffJPBZ5e2hOTch4ut0utrSjjVpT2r/I4VqPii7Q31bA/BR84IVIprbmAUpPIoO3yaGb2W25MLlP0TvrnO1dXKUHuc//OqlVPHfMLx8HZuElYhLw4MSQpodjw00wL7kyguaE0Ytn6YFUpm5SRHw+bSbTSUuDWaOcf9HD61788lci1U9T4wS/3nYgblMba6vDWsW9Lc/Vhj/7xVSnw6TWYOW1u/M88CnaQSGA4C3WaBMzh6+QVgqYcMksG1H5BHw6OcEAS5vmKvVHyz06pzeYK0jxGRd765PC65ZesFbbEaku/VlBxJXYLBCwhmWrCRQCK0nCanACy3ZkcJ3ri3UD78e7Tm4jaV7CCoUORPobVKgn pJfkiR6z OdWFB65RBgwSxX9WnMAC53ysDi5h4l6MTnfAoDiGlsdp+d0VuvmAtdnrbQONnN66/DmNqemCDobFKfXkCaAPtUhT/nVis4JI7rhhOIlkY9fKGMHWnjQ/fDLmaN1lSL93tk0D5CQ1p1K6kzwVah36hJZBphd2k5aA0zsVOcfGDCQ24+WwwulUhIwP8CC8ZEi1Ucp40xseBEM3Q5TUcXYqw6t2Z00riJ53TW8jdvR0LLXuD0ahuYWm5XULItTPIORNAjK9qAirIK4142KZG+MlTO2tRMNzxbyWVG+Zf1YmElk+dZkJWraddUWPrDKSYiP48UhyhNevxj+o2r3h4I8GwQ/RDd92Q2ea/VUwd5Tr7mXAFD1R8PLB42fUFNoXsOKR4QR7A3cCIRbJaAO9wykTEMjuNfx7TVil7AxMnSmhFXL95SsK9aH9ILnewOjSLacZ+yln7hdElGpmOF7KL+8v9xPYuAYo3544yGLFB 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: List-Subscribe: List-Unsubscribe: Extern declarations have no definitions with !CONFIG_MEMCG_V1 and no users, drop them altogether. Signed-off-by: Michal Koutný Acked-by: Shakeel Butt Acked-by: Tejun Heo --- mm/memcontrol-v1.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 56d7eaa982741..db2ebf8bea6c5 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -140,8 +140,6 @@ static inline bool memcg1_charge_skmem(struct mem_cgroup *memcg, unsigned int nr gfp_t gfp_mask) { return true; } static inline void memcg1_uncharge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages) {} -extern struct cftype memsw_files[]; -extern struct cftype mem_cgroup_legacy_files[]; #endif /* CONFIG_MEMCG_V1 */ #endif /* __MM_MEMCONTROL_V1_H */ From patchwork Mon Sep 9 16:32:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Koutn=C3=BD?= X-Patchwork-Id: 13797305 Return-Path: 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 05BABECE57B for ; Mon, 9 Sep 2024 16:32:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77B586B00C5; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72BDD6B00C6; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F35B6B0191; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3B9E86B00C5 for ; Mon, 9 Sep 2024 12:32:30 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F292840C3A for ; Mon, 9 Sep 2024 16:32:29 +0000 (UTC) X-FDA: 82545742818.11.E1594F0 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf28.hostedemail.com (Postfix) with ESMTP id 140D3C0005 for ; Mon, 9 Sep 2024 16:32:27 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=dFmcYuRC; spf=pass (imf28.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725899446; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sobUieX7sbiSPYFy6bxdFPzYBPZvmuQtQFMPmLF111k=; b=Qni6Pt1A2IDzwjyrPaixKvhLcf5HFSJ7eNkDf2CiXR0FTjCyMdxMIJiMXvPHI2qeC/+OZw ZdGNTu0wrrLR0ijvJM1gZSyM4W+drL08EZV9OS9SWWCND/4m9KgSAOPZ8D23FUysEEfNOI luUUv0DQvUbRUHdq35LDDVgAA3DHxPQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725899446; a=rsa-sha256; cv=none; b=0p2nqWaV6twr3HfbBHR6VOC4kufSdSuMFZQr62PYqiqZunsy+LJtCbiO/rzKxk+z1pM1Aa GKfaSApIHT6kvd1ljaNOOTQ5RU8Qs6GvQFFG1qoaYGAGzSKbUurAJg0LBs4ecju51/QdEa FfIF0homU+787n26gAaZ+Lk3+jcWxH0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=dFmcYuRC; spf=pass (imf28.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cb7a2e4d6so11216175e9.0 for ; Mon, 09 Sep 2024 09:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725899547; x=1726504347; 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=sobUieX7sbiSPYFy6bxdFPzYBPZvmuQtQFMPmLF111k=; b=dFmcYuRCA2+BmVVdbXcbOa01rj5cUj5RNDF3afM2zsAYwBlCp8Jj/lQF9oD1MBrn5q bB1QflDQzfhCOrUlDXNAmVnVkBk5WLFJHTPGEOS7d9ijTCt+dK0NPu5YBkDxVXBtG9sb daYotz8MH3fdjX73shdkuTXeAYWqnxpnc5uyHBkHyxTOKQnu4+gxIcm7eilGlUllIeeQ Oc93aEoUoLKIV3O8Uz8nnAhnANbxhZJoaL5kqlI7OsJpyg+BAFZfO7o/111R61xLZPAR AhL+oh0cb/SAoK8gx1PWiG5/og6sk688aukixKBsGb9wFvySw+FPvOauOaMarg7VygNy OMBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725899547; x=1726504347; 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=sobUieX7sbiSPYFy6bxdFPzYBPZvmuQtQFMPmLF111k=; b=jnp0hhXmZOdR5mc3em+XJGsC7SGERNVHkrujflyeeKfOBA8i4ildozzz1i3y1bEvJH Wtvt7FIw3TTa5+Vl/BQ6ZmaO/dEWDurKjILZQZax7zFpUKwryPItHn5sds/PsRJxaZ9f uCU+IXrIF0gKkvZTDGGgKtgBbUxFxKNWUGvysMstd9L1GFIJIjTxjWhahzd4abRD53dl eNG92HZPzQNqwu9v03+IpZYtbqW7VXK8g4LsP/4NJpe4+vht+UTKa3CkzVsH8FkirBQa a/FQ5BKB4a+ddzwkF4zdEYjI44izVDELlzaMViZO1hH/FA7mfKT5pVfZgTBuz+7/KH8P zabg== X-Forwarded-Encrypted: i=1; AJvYcCX4WAlUrfgO+TFtXZjJ+4xG17ev/gZBc8vBNi5Y778bvBu4U3oAPqPpOd3BO3SbyPYm73P2AoVkCg==@kvack.org X-Gm-Message-State: AOJu0Yxoy2hz44KsdgfG3XAOOOus5Phg056SiVn5YEqudwYgRbJ81qh2 OA+MNZmJfcXMBByfaJ/yPFsVHEaGfQcuX7D6HJyHKXnu991G/QJlnAKM9zOA+kRiEGxU36hlWAi k X-Google-Smtp-Source: AGHT+IHP56w+Vwo326v4est5mKtZvXJI1kCa6K6pwhkIOZ6Q1r5Njpbo29H7KJ8jdrsk9xU+NzXgbg== X-Received: by 2002:a05:600c:1ca0:b0:42c:b995:20d3 with SMTP id 5b1f17b1804b1-42cb9952478mr18658765e9.26.1725899546518; Mon, 09 Sep 2024 09:32:26 -0700 (PDT) Received: from blackdock.suse.cz ([193.86.92.181]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3789564a072sm6478606f8f.2.2024.09.09.09.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 09:32:26 -0700 (PDT) From: =?utf-8?q?Michal_Koutn=C3=BD?= To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Zefan Li , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Chen Ridong Subject: [PATCH 2/4] cgroup/cpuset: Expose cpuset filesystem with cpuset v1 only Date: Mon, 9 Sep 2024 18:32:21 +0200 Message-ID: <20240909163223.3693529-3-mkoutny@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240909163223.3693529-1-mkoutny@suse.com> References: <20240909163223.3693529-1-mkoutny@suse.com> MIME-Version: 1.0 X-Stat-Signature: p7zk6xj9fkzb1ebo9i5pt3bdxisaqroz X-Rspamd-Queue-Id: 140D3C0005 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725899547-825659 X-HE-Meta: U2FsdGVkX1+3hWv3bgJbpE1Hr1aVSw1vmNR+5ldy0aVhobYFlkgTz6JpaQabcPnbLLS34iPqDknaz3qTqoy6TuEQlctW+TmrqXQw3igW89SF2ujZNztLKZQDb83JTPTBjqWmzLM06ZhskKQPt6nHx0JegFXpasUpIMqt49zKaHpMTtl+9To7UItaA28pT3ufGS0PJINH9g569YmbEg5y+f3L3LSyNrw6uHrcRJrd+2PKoUERa3KquMvrwUiqo10PysQRkACzD+Gyfuf70MEH1meyoey7JDNoieyVFukvHO/tMeAzdbmZFbjthsRxds6xJXq0vOpraGeeJLMJ1CaFagkzhLupvZBXC15IfJgoMZYPLby2J2kGxiEr0Tfyf7bWhqwqJ4/CtNCS5NDZQtKG6WVVdM5dPCcRkZ7Y+oW6Q3f7W3NMafmBsG3OThCjPzHzrYWKR2wMykKPGrpXAepK899QHoDnEbh57r/AslhYbFrvqeuw8KU4Xvcu+AYpNd2zE5Ycp0yswO8zvL4jRWmsbUnUMY5cL5EHvb+YOLEg7wbj5QnhKl+ZlqSNWvWnDYHH2GtEAsjCk3i139oYuUt8dVM8SmVEU5kN00qmppHfA91W49RLmP0yt6HcR2JTVMpqDqhvxxBJuLC4ICf7csO86u1gcNpoTyz+dnEpdleB5k6cNCVvVv1jkLt/bTywfVHbFC0/UiMC4AQuxitxd+tS3ZiqISw5mYhU+2PmBi+KwtB7Uc3Pr8x9ssUU0dTctfDPKMqVcIFVLXPBoCGtXslStPLtOfc1LeqWDIJ50atSS3DPeXoo/3Lbls0c8efWD0LE7BgnpDw9TQrKcLua3SkC2veMnJTc9HYWuwwecP4s8zVs73pJ5KnR5WRnDOCvgGV9qz1LtBPnCa55lfG+EsWZboCNM+k8+8OHJZgWTLXAYDrZmxqnYvi2Tk6TMYFCXXaBbQ1VlPNoKVMoLLKa45t DLlKW1dI XDgbSjNKjqkuQRZbPW5SwdZi/PvXHPLFA75l18HwodRmlCPW8nd1RYGdXjIWkDFIvxzU09tGOxsnqCS4xO/w8ILO3Y5VG7Ke8lcnSnQusb8aGRbHuwP4tbCOoFs8/zZIeH+neTYuw+ju/KprmG65KhBdnZa5PrUmVEQ2A7sLMnedxiPNmqOOX3z/4tK/bxg/f7gsmACYdirK4JJYhUREHAe3QFamZMKAw9haY+uBTpDYnEN+8po6Ku/tE8ekDRFRkxXDFbWZTvQdAcOFfXPEYD/qPhDv/1RExz/pK5pMS+j82ELyIa771yIcm8qJROsKcZs/ZSSthE0UbkujhKCHyDBeysER+xLljgaTxn47dG+pInMM= 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: List-Subscribe: List-Unsubscribe: The cpuset filesystem is a legacy interface to cpuset controller with (pre-)v1 features. It makes little sense to co-mount it on systems without cpuset v1, so do no build it when cpuset v1 is not built neither. Signed-off-by: Michal Koutný Reviewed-by: Waiman Long --- kernel/cgroup/cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index c72e18ffbfd82..90e50d6d3cf39 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2331,7 +2331,7 @@ static struct file_system_type cgroup2_fs_type = { .fs_flags = FS_USERNS_MOUNT, }; -#ifdef CONFIG_CPUSETS +#ifdef CONFIG_CPUSETS_V1 static const struct fs_context_operations cpuset_fs_context_ops = { .get_tree = cgroup1_get_tree, .free = cgroup_fs_context_free, @@ -6236,7 +6236,7 @@ int __init cgroup_init(void) WARN_ON(register_filesystem(&cgroup_fs_type)); WARN_ON(register_filesystem(&cgroup2_fs_type)); WARN_ON(!proc_create_single("cgroups", 0, NULL, proc_cgroupstats_show)); -#ifdef CONFIG_CPUSETS +#ifdef CONFIG_CPUSETS_V1 WARN_ON(register_filesystem(&cpuset_fs_type)); #endif From patchwork Mon Sep 9 16:32:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Koutn=C3=BD?= X-Patchwork-Id: 13797306 Return-Path: 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 297FCECE579 for ; Mon, 9 Sep 2024 16:32:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F5576B00C6; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A7406B0191; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41F6F6B0193; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2155C6B00C6 for ; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9F56680ACF for ; Mon, 9 Sep 2024 16:32:30 +0000 (UTC) X-FDA: 82545742860.11.A1755C2 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by imf28.hostedemail.com (Postfix) with ESMTP id B2BF9C000D for ; Mon, 9 Sep 2024 16:32:28 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=ahv4hqVY; spf=pass (imf28.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725899497; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3hN1sbdsSr5xjIEEi3K2BOZrBarvDPImrotZrDBVesU=; b=HtDrAsQyyjNli1rNOJiWGfbKcTWoqQqoVVqjXR4MMH+aV0nWZw9Gf5zwEwFo3AETk3to9l f8d93IiOnp+FTMDea1D8LCYU6fd1Iq24AO0Bt/EeTiotV2H4QAluKjqfBSC5EO9Ttm4OFe +/gOFX9AqXVbIA0erF7vayKdwhH0iQY= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=ahv4hqVY; spf=pass (imf28.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=mkoutny@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725899497; a=rsa-sha256; cv=none; b=0VSyEuSoCsAX+vWopLXVVmrCTWl2FsKbl1RfyP+3HdnYG0yiE24Ljz92zReeBpyKCvDf0T /zr08PKxAYeemyVEhXXHuOaU0wAcaWcRG7BgEAYHemxQm7w9eH4ny02Y9GofpR4PfbgZwe /YfkJdapwx4G+Mezwmzw7Sw/SovtG78= Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-428e1915e18so39228495e9.1 for ; Mon, 09 Sep 2024 09:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725899547; x=1726504347; 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=3hN1sbdsSr5xjIEEi3K2BOZrBarvDPImrotZrDBVesU=; b=ahv4hqVYeK3XToFHEl+qeRjqr8VcJANwDjqImYBfRmcjEbu8NgiE7zdYoq9F+cH2OR NVdOzno8eYZmw4KDGAa6TNCmXOd8ud8W4zcX2MgfskVV2B2cy61NiQHWqtbdokxs/aKh GwZJOcA3c/OMOhjs4gglnfn2A5TpJd/nA89WDtqrknOV4vrjeKoDl2WYAywiLpQZycWj iRr6YSM0NqCYDXajUw4I6oOQ0T29DCqFB1zDp8YWB+XYypnoiFzdafBGeBmH2MB0jhwZ FAQmQiMZisaNoowYgw7rM9GtJJoLw1iUnWlprqPJJDvPupSs/O2+5JjH3XT/8vBKL5NO D6HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725899547; x=1726504347; 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=3hN1sbdsSr5xjIEEi3K2BOZrBarvDPImrotZrDBVesU=; b=JZRfpvJQFvh4QgiHVy8WTLp3ZKqNZvfyNwe3I/RtUo92l9DaFFey7Dyvem/3BnN0KT iB9eAupn6YphE7nQSBGfuOPX/OrrpYxxAx87y43lSXitxQlkZS5fFBD3ProHbveV71dE RQnuVpeWifphwjQy9NCmDXe9GxNAVLxC6Nhz+xAtt6DMBUu77lU2qU+U2Pj4JtLcChVl y4QMCflNTTFG/m6BkrsrWhG02xdn3ceOCqc8SHsJtEmQKtPdWX2GpU71bHUlSiLK/pwT CTv1a8c1ZHN5kLaEEHaiju18m3wdzAAstAC8o+dVTp61g4co5Euy/8oL1LnY0+KmvvkD mfig== X-Forwarded-Encrypted: i=1; AJvYcCW26gcWmetT62Qtq0kuOB8LT3ZKwIth+JvuJL+xaR4Bz0wCJJvkIWse7tWqrWTAQLgBOOiIry5VLg==@kvack.org X-Gm-Message-State: AOJu0YzwKGSHEsc2VGP/xIGIiajfNvuAUMrHef1C77bvJxlmFFU/acxL yfyrVqsjsPKnyQNjsnTjDBNExGql1wV+IThO4FJ5dow9fFlWvoTy+mLxfN/g528= X-Google-Smtp-Source: AGHT+IGxjAbrDtFXLx+iO1e9KJ4se6OA7eld34L5kuJJJmD5mvX5+Dcs4EKLQGfBldRlsEeQGM6bsA== X-Received: by 2002:a05:600c:1e02:b0:42c:b949:328e with SMTP id 5b1f17b1804b1-42cb949341dmr21798805e9.31.1725899547259; Mon, 09 Sep 2024 09:32:27 -0700 (PDT) Received: from blackdock.suse.cz ([193.86.92.181]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3789564a072sm6478606f8f.2.2024.09.09.09.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 09:32:27 -0700 (PDT) From: =?utf-8?q?Michal_Koutn=C3=BD?= To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Zefan Li , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Chen Ridong Subject: [PATCH 3/4] cgroup: Disallow mounting v1 hierarchies without controller implementation Date: Mon, 9 Sep 2024 18:32:22 +0200 Message-ID: <20240909163223.3693529-4-mkoutny@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240909163223.3693529-1-mkoutny@suse.com> References: <20240909163223.3693529-1-mkoutny@suse.com> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: B2BF9C000D X-Stat-Signature: nwm1k98buiuun75u1zmrica1prdogshh X-HE-Tag: 1725899548-437605 X-HE-Meta: U2FsdGVkX190g8Jt6BVEhEBF2UTPz8UBsCPes4LX+RVFfgc7b3DGsiWgoImx7yjQZBhhyBMIsD8NwsCboBNxILZN5Vf4G2LbWAnNByhFCBgMZjrXLKzTxgj3+Glixh/ma/x3tS5h9Topc7COwyHAaF8iN9m+saBXgm8AqEAIp66OjLoMgTwaAVZVF/7AcYSPc+o1TTWzTcFo3hUTOcV+XzvAwOqKM1sFT3LojZUahMmqSjoGrGwkOmzzCKVXaVInTemTADmjxzUeX6JILJa8pZnUvKNdADtI2EafR7ZFuoigqXhJiAzwibjih2mxNZFS8cpv248Fy6AP+sLp3WVMSpWjAd4NOFhpe+LcVAwUCWu/CoAzb7jM8X9430/Cr8wnDNGc1KPRW5K9iknG5QQa17E6gHwpQP4rK2sfTZ36ZSwfb1Q8ti8R+n4uTv//4O4qKS5D8emCK9eG/XcX/Jq+F5ZIisMoBpbNcrGf5sJzuzAoavk+1sjW2WOk+2ni2x2hVWvXmQmG8KQyOjmvu/ADn1NOIFjAwNtRlbNOO4EUj0AmMSBXqu50N8faDjRtwporJbvz7bs9qWfb18r+HGwzRRxgAH2Yh8BSx4Qsx/9WwtY57m2lzlktObejyqLYXXRv4Cm5ByJ6ojFe1cJk8io/aqdHGujqePKMmlrko7jf1PCgSBmbYyjY/DgGQSVaaTGh/X7nnG9QO1QiYocit8OC8a3kGWwLmNc1xge6bDvNy1Er6IvLP5ENZD9VOZ1y2wJluWwQiIOMKA9Iit50wSIJHisGifmlP2uEzwV9IYnXhcJ3oIjXTlGhgIlPTBT0LRWLpQ5Svhow9nNI48+bw1CJ6qdasjdpVYlPXLOkuHqPrS4AuJJ41dIodq1yXgbVDsU6I0oOQKKK6yCg2pljt9PbGDBuK/uy3qzgmoArNn0nS7qfvzXQZbUgonmYdcdIEm2P4+FABilbygTwhicfyNX DMc9rOCF 2RfrakL5RdsIKYpnFFwDH/kA54HT9vSZ/1/ZNTaR/amzggj0hzVqJICQ/HjUoJiORWIPRg/4oTyfSpozNi6JZG9Yz+StyreAzMdpALnBcfLZxCjh69Oyb536VHJXxGRT/lhScXh8/Iyc38JfJzKk+r5YkAGQ0SZJ/gemwTzMftMjpgmLN0JIdyfBoAl4IYY0uJytEITogrgme17sPzjwadttL8V1UnjoiRBb/Jvn7xxyv3pDvLMVuSuTc4sqqEd8gYicFVQDFhmTIC6CHsxqcxiUvDySjcnQaO8wBzhVbpeSl0lCNCUKvl1Brf40rNZxG5ZXnW9V73Sn6X4JEdWar26SPB43r5ePZhgKMN5JUkIYRTX+Sg8vfiNNat0jfhvSlleI6 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: List-Subscribe: List-Unsubscribe: The configs that disable some v1 controllers would still allow mounting them but with no controller-specific files. (Making such hierarchies equivalent to named v1 hierarchies.) To achieve behavior consistent with actual out-compilation of a whole controller, the mounts should treat respective controllers as non-existent. Wrap implementation into a helper function, leverage legacy_files to detect compiled out controllers. The effect is that mounts on v1 would fail and produce a message like: [ 1543.999081] cgroup: Unknown subsys name 'memory' Signed-off-by: Michal Koutný --- kernel/cgroup/cgroup-v1.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index b9dbf6bf2779d..784337694a4be 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -46,6 +46,12 @@ bool cgroup1_ssid_disabled(int ssid) return cgroup_no_v1_mask & (1 << ssid); } +static bool cgroup1_subsys_absent(struct cgroup_subsys *ss) +{ + /* Check also dfl_cftypes for file-less controllers, i.e. perf_event */ + return ss->legacy_cftypes == NULL && ss->dfl_cftypes; +} + /** * cgroup_attach_task_all - attach task 'tsk' to all cgroups of task 'from' * @from: attach to all cgroups of a given task @@ -932,7 +938,8 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param) if (ret != -ENOPARAM) return ret; for_each_subsys(ss, i) { - if (strcmp(param->key, ss->legacy_name)) + if (strcmp(param->key, ss->legacy_name) || + cgroup1_subsys_absent(ss)) continue; if (!cgroup_ssid_enabled(i) || cgroup1_ssid_disabled(i)) return invalfc(fc, "Disabled controller '%s'", @@ -1024,7 +1031,8 @@ static int check_cgroupfs_options(struct fs_context *fc) mask = ~((u16)1 << cpuset_cgrp_id); #endif for_each_subsys(ss, i) - if (cgroup_ssid_enabled(i) && !cgroup1_ssid_disabled(i)) + if (cgroup_ssid_enabled(i) && !cgroup1_ssid_disabled(i) && + !cgroup1_subsys_absent(ss)) enabled |= 1 << i; ctx->subsys_mask &= enabled; From patchwork Mon Sep 9 16:32:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Koutn=C3=BD?= X-Patchwork-Id: 13797307 Return-Path: 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 E2C05ECE577 for ; Mon, 9 Sep 2024 16:32:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 201406B0191; Mon, 9 Sep 2024 12:32:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EEE96B0193; Mon, 9 Sep 2024 12:32:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA5E76B0194; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CA1B06B0191 for ; Mon, 9 Sep 2024 12:32:31 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 795E340C6B for ; Mon, 9 Sep 2024 16:32:31 +0000 (UTC) X-FDA: 82545742902.03.68D2C70 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by imf04.hostedemail.com (Postfix) with ESMTP id 788EF40018 for ; Mon, 9 Sep 2024 16:32:29 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=ZFWetnud; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf04.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=mkoutny@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725899522; a=rsa-sha256; cv=none; b=YX48Qi7ve/m9Jj6jSfNjOJ3k+dMZt51pjicX9TMFkUvY6trQ/oCHCkwbPOKN35MkwgiCgF /W+s1hoQnIXeisFnn8fKedHWaqUZfkIPR4Q2gdkv4sQ26L++JCYQzlwTWC4gXpNqx8O2QE Alu4pFrEGDYtmu3spKKe5VPKpJ5rtVA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=ZFWetnud; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf04.hostedemail.com: domain of mkoutny@suse.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=mkoutny@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725899522; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DHl5njwEzB57TRyVYxUn9e/V7vkUkmiZqA1k5LmJoXo=; b=0ilQIC1kZO6v0WK3YAWtyQOJ5HIoShlEF42gqclSHiV4A5wg6hY6pqvpmwhEQSKQcZ28H7 omHttZhaSWTp5+T8iYqoaYWQN0yvf7uLCOQJpZRTzpKEdDDj31r3GNwEn0WN3vcNJJAOcV tEN41rc1vllh1mTkYFozaA8/d/4sBKs= Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42cb2191107so12985565e9.1 for ; Mon, 09 Sep 2024 09:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725899548; x=1726504348; 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=DHl5njwEzB57TRyVYxUn9e/V7vkUkmiZqA1k5LmJoXo=; b=ZFWetnudEV57IvHzG6AiTbdxtPsNdFjdsOShVZJb1BqxYGj925HQ1P74DwHJN49yGm dlTAiD9hgAYoLASveQ3y7dRaXmbHEzeXaJXysKyFGF+snXGJiB98asiyep5rcopuvEae P68EB/BO2UPh0aZNAFvHShB1Cc03ZJeee8nYJ8OizH3SHlbiaCKVpAZ55CrRqSVK3x7H z1PCByTfl6Tp7TaUBtuQkfBLXZZfyOX9yaNGL8fSECPs1WK9a/xBOFuC21GrvLLZHeEH lGcV1sOwa/1IqN/+PCe3+eApWI0bjuV3mwkYHXwAxHp1AN14leq58MpTcPo5OeJNVMGN jdVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725899548; x=1726504348; 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=DHl5njwEzB57TRyVYxUn9e/V7vkUkmiZqA1k5LmJoXo=; b=C2hBZVrrpeAxHHoNOwGwHZmNT9RalC+Bx7DjoLQTgzIP/5k36PiJGC0xXFTTVe28PX qjt2pVte31G6gA8kmk3kr/MBHZW4qy9wnXWlGS1SCFvhCqNwC85S8SH8Ftk9p2/1TAL4 MJNrVLNDTw7mOOx8MC2wNnLwxdVep5av/Gb3QXENOtHvaC9daz1LfI06skHpIy94dJeD joseQoV4Kq27ZxLv8z2T4uc9ny8ihUiNtpAJ0aa5IX8PvpjGsypeDwSa6IbgJQku77cF qC292o+CjCzW9a7eMZh3NYcJSjs+/DWNX93C1IctJHmUk/8msYkl7gwSBvFOq3LP+QcL lRQw== X-Forwarded-Encrypted: i=1; AJvYcCVRVxNfgzZf8BPTcmXY57T0KGFtIgb+m9zWzOkVPatNGf7alg+t03UluWBH0Utl3iL/gztjyI412g==@kvack.org X-Gm-Message-State: AOJu0Yy1R/gnIudU3TAQGN/BqKoclPeCiuKZvevojZuWpIXfwdxKhFAx kCTq22S+XdtGyrqdzxV9A43WqTdbyH5i3xl0eH0HR/sg/U65qskStLxFh10+5BFvrAMm+svcaz4 n X-Google-Smtp-Source: AGHT+IH/NtJ7GDbpp/KCJNR64qpb8/rUL9ftAz+gBxAS7bLeKc9E0iYJrQXSaE8AaWMsJe84oBWC9A== X-Received: by 2002:a05:600c:314c:b0:42b:a88f:f872 with SMTP id 5b1f17b1804b1-42cadb699b9mr62524805e9.32.1725899547875; Mon, 09 Sep 2024 09:32:27 -0700 (PDT) Received: from blackdock.suse.cz ([193.86.92.181]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3789564a072sm6478606f8f.2.2024.09.09.09.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 09:32:27 -0700 (PDT) From: =?utf-8?q?Michal_Koutn=C3=BD?= To: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Tejun Heo , Zefan Li , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Chen Ridong Subject: [PATCH 4/4] cgroup: Do not report unavailable v1 controllers in /proc/cgroups Date: Mon, 9 Sep 2024 18:32:23 +0200 Message-ID: <20240909163223.3693529-5-mkoutny@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240909163223.3693529-1-mkoutny@suse.com> References: <20240909163223.3693529-1-mkoutny@suse.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 788EF40018 X-Rspamd-Server: rspam01 X-Stat-Signature: 5n66xrzi93xyxwrwtgg6zqfws83e5ias X-HE-Tag: 1725899549-796300 X-HE-Meta: U2FsdGVkX1/HTI+neKFI5clPwS0TMsGo1taDXUX+wU5+M0K9sQZDmQ3cuacQwASZQP4PjFsR0gqE9QdG+6/TJzJnjN6BhHid2bB9gB+RSipb2XCdDZFluPealfxtijUyf9sdnhxnGtxVgFASVHmlLc4o1BMFFDEnn2B4HtlkDp3y8m/2PbgUiGP4JSRiTCer5y1qPhirtZIgMBu53OYQM2kMJNKzDrIlSpDhdT65ewMzUrkAxm1l28q3+6C8hGcFkSQiFaXN5U66HamS5KJiKq72vVvEK5HlcWSSMIOwuiQQMiBfGSZBe9eDIYUPZ/vsmkP+N8DonbOgmG4B4/3B01O4Mig3pryZUfcAIoEwe8epV2n5KB3czW6kV6xRyRZ0HgLrMaGHiTP1X7yK4j/1h4ytdt87qOqBu0ibKHv1zMGVHZrUTHylzz4lSjLUpiihjdDbB5tb8r8FCnw0vYCWqEHQ9f3ptLrtbFGNmIjfczO6e4aA8j0WRGlSvQ5PeVxXg971v87jHwhBpWIntwWKXX+4qT9lqQOZSs37DuTZMfrdFIzR9HVxu7LnTsI8T+LWRRUjz6usUdI392rZFGtc0QZonOYS4Sig8ZZVzcWRn7qeh8vxZ6tSNVQtQtFmmECS4mn8iO/BdveNJNea1YvJWNAdypfDAwlnr6tF1ugcxAdmW7mKavwqyhriBBkomjcqi8j8+21bewNoOSH4nMhwIHqJ/vNeeG2GR1ir3QWHL/7Pw8V2JERSGoLEaXrX7inUFp7nu5Y3sHVXLI8AxsXG4PGz66Wq74/LE4JBefQL3ddSoIVaVByGRd3FL49La9wvwfEasAwzt1z92X5PZHgrSjNiJ57zN+jFEWFoyMlU2IcmHQu6lTMs9MJyM1WbRHXUqGrAfLUrj63sippIU+5l718SXd2dgmFAwJAMopxueE/i0Qt/XdrXOuqXlKBEuUSsjKdwa65Kgj8gOqocuAy THel+RxR cbatEZXbGCn0fX44cSJy8HC1mbnNDuEhqXYNkkpyqpNoMPueT5ymtIRvqh5Ha8reeF2rf8/BP3/87qB+Iqveo9B5ERo8IkHbu5JPmn+AGVPg2r/S90PwTz0P/CGyLhNrBmgp6Ne3W3kstEW6Bk8BGJITxag8bZh6mMyhH8F9Hc8nA9TuZ5Yw3izHmuOkIpeDwZ9Snxv2FWNse7OLr0DZJrpnG92qosQCIFzjRP9ttOHr+Zelrq6ZseXUwIMzAig/h51YsrtkumpYAuov6Ji1CdwhocPZsFiEhfTD0y6kNIJ6LLqauz0XhX/JdyurITBWST8vFvXDkqnB+qqLQvGgngx/gVtuOehI0Vsf7pcS+QxvEkqk= 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: List-Subscribe: List-Unsubscribe: This is a followup to CONFIG-urability of cpuset and memory controllers for v1 hierarchies. Make the output in /proc/cgroups reflect that !CONFIG_CPUSETS_V1 is like !CONFIG_CPUSETS and !CONFIG_MEMCG_V1 is like !CONFIG_MEMCG. The intended effect is that hiding the unavailable controllers will hint users not to try mounting them on v1. Signed-off-by: Michal Koutný Reviewed-by: Waiman Long --- kernel/cgroup/cgroup-v1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 784337694a4be..e28d5f0d20ed0 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -681,11 +681,14 @@ int proc_cgroupstats_show(struct seq_file *m, void *v) * cgroup_mutex contention. */ - for_each_subsys(ss, i) + for_each_subsys(ss, i) { + if (cgroup1_subsys_absent(ss)) + continue; seq_printf(m, "%s\t%d\t%d\t%d\n", ss->legacy_name, ss->root->hierarchy_id, atomic_read(&ss->root->nr_cgrps), cgroup_ssid_enabled(i)); + } return 0; }