From patchwork Thu Aug 29 21:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sridhar, Kanchana P" X-Patchwork-Id: 13783907 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 3C875CA0EC0 for ; Thu, 29 Aug 2024 21:27:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7D966B0089; Thu, 29 Aug 2024 17:27:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A08526B0092; Thu, 29 Aug 2024 17:27:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 833566B008C; Thu, 29 Aug 2024 17:27:14 -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 0E8706B0089 for ; Thu, 29 Aug 2024 17:27:14 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C01974095A for ; Thu, 29 Aug 2024 21:27:13 +0000 (UTC) X-FDA: 82506568746.28.97CC936 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by imf19.hostedemail.com (Postfix) with ESMTP id A7EF11A0007 for ; Thu, 29 Aug 2024 21:27:11 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=OuMRmqgI; spf=pass (imf19.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.19 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724966787; 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=RTs+0Yqd8sZSHUC6ky5gE4k/LE5LQXAWkMtzsx0yAMU=; b=sTImh7z9FFxBUXk4X3aXyRm1QTVAb1bY+8mLSBanxlcM6dYfva3gZlzdUiLBD+tus0tzlg 70p5mLiMLnr4tYJb89w5gGgP4NFQw+7/Xd2NJuzt9J0GX3mF//ko1tQgkp1xM/AOxaOSKR gxOUeorDHNMJqL9BtCXi8ySk60/lO4M= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=OuMRmqgI; spf=pass (imf19.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 198.175.65.19 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724966787; a=rsa-sha256; cv=none; b=X/hNjxduPwgSE7AMtO38sviSg6kWy4P+3hE2JDLcKQHGz6EFTjeTnu50vXPdKVWD6gzuFo 36Wiq63AxpkJzZBBs+A9NtoZO9KMfjJvbP3d3phcRwIgRGQwk7J0zsXkRGRq5ZSweVvYBL U8Z2rt6WDjduvdqiidzCjlyxrXKqJAY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724966831; x=1756502831; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j6MRHvvdb4Y/ecSm2gb8TOi+Txe+Ci0dZeAdkAYjrOU=; b=OuMRmqgI/YOxW/k4xA205EJGFaHzqc8ZYt/zTJzY0kLKCTdYbvRRe+OC ZIH7RnmBsFyBGEmFUm6axrLXuQMAR1owUT+rnTK9OkSvWwHnAWeedBcr4 Aoztih4FNU5PMVniCe9E25/39NHg6xu8dRhR/Ah8ZmJgN6rW27HJSVRdS 1fo8xU5AvBSCGj34ec1/9IBMOgfhwvgsVueyn3Qr7fbcXjL1JY0Uj5nAQ xZoLyYC4wsd1wn4g+eMIbe72a6d5dgtP0oY9c5j4WYpF7HHfJhiF7LvSM 0T2fIA/limKmJiX8TgEoj90DiPzbm/wlLs1JoYyJ+HUfENGl18u4qgm72 g==; X-CSE-ConnectionGUID: mQz6G680TKWZlaijJ08Xkg== X-CSE-MsgGUID: DbN2NuTHSL+xPMsOZzHt6A== X-IronPort-AV: E=McAfee;i="6700,10204,11179"; a="23455197" X-IronPort-AV: E=Sophos;i="6.10,186,1719903600"; d="scan'208";a="23455197" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2024 14:27:06 -0700 X-CSE-ConnectionGUID: 4beK6VF2R0i5a3dChDlt9Q== X-CSE-MsgGUID: hxyTs7R9S0yeZGOx0Drw4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,186,1719903600"; d="scan'208";a="68365406" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by fmviesa004.fm.intel.com with ESMTP; 29 Aug 2024 14:27:07 -0700 From: Kanchana P Sridhar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, usamaarif642@gmail.com, ryan.roberts@arm.com, ying.huang@intel.com, 21cnbao@gmail.com, akpm@linux-foundation.org Cc: nanhai.zou@intel.com, wajdi.k.feghali@intel.com, vinodh.gopal@intel.com, kanchana.p.sridhar@intel.com Subject: [PATCH v6 1/3] mm: Define obj_cgroup_get() if CONFIG_MEMCG is not defined. Date: Thu, 29 Aug 2024 14:27:03 -0700 Message-Id: <20240829212705.6714-2-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829212705.6714-1-kanchana.p.sridhar@intel.com> References: <20240829212705.6714-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: A7EF11A0007 X-Stat-Signature: udadi185qmoozaeistchkcxw3ecmaqkm X-HE-Tag: 1724966831-24401 X-HE-Meta: U2FsdGVkX1/Thk8UyKtwkfD6ZMmai4HvfsySGlq9ebYOH/bNdxl5uvOlFjmVqwKJf9odtGCHuVG8R7wCxZj84/riE/KdxeaE7Nf/Is2zz/3F3aI4VEsTXRcs8lSfWsyHpS07HbFdk9s2+q+Jlm4GnxEQOpT/IEOlmpXJf99BvtVsa6I1OT4f6ZVT8w8pv303hUlvyRfZwBEU3JUV9i2cB2KxgVRDp2XAW3AXipH5DWz4ZjY5gj6R00HfdMz5QQAv4J4G3Y7r07P24AmRyFGHnGXXdp+ziEOLtMfqhcQmkG1lwP8VS4xDFbiqgnMvNFDgAFYTn3SjJRCssS7919rUNueCfUYWXhF9LSgMsTgF8DzTJUHOa8C6XvF4su/eHDtPnCE6tN4BZqi/6Y9WELLNb2e2bxWei96qx444bui1Lb5OrNpzbdcHVRLXMbBHXMcmypQdjh/glj29aKpcpKC/AH2emBK/p/DIx6xRYb7s+NRlZ459wcK35cvhoadG+UYDX8gx8WTje3DoNq6f83b1pmO5f9ld9YD9zPFMDKAVhmI3Akf2h2fRaAnqGLivMLj4EOqBKrbNhmTEzQkz2JnpOxSaKKAwnP+T9okgD17nsXn+CaD8ooW+hRGXhhYRBbykWK65RZidOZ9UiH+l2HlgkMO5z9W8MAuvtrG7ptpZKxIKC2A02mIoF0/PM1RBvIwSp+niAs0LnM2AuIieTRR3uW1+INdQiSbbM5VV6qzX6r+bgugFDDd+NppckZAI1odIva1McDExAwFtrOEnk7IApnwUZMTJKVI40zOgl7c7rw1ei4QJYoMVtScsDUgj8dfJC1/Tz5re7cUv9blOkPNcVdKnkxBHsEdRWdRH7zuS0+DHtE8BqzawkayW7L6KRp/6D9sfl8l00zE6SMYqHm+p6jSuk1ugDjHbPwp0FxGFzXiFhVc90njTWJRbdZrGqC0JSOxUouYY5caeFE+2pcg 8Cuo9mz9 6ERoJFDO9ZtqDlHs4ccaCMDDHV6GWF9obOpity3tyze4LtOcieGFyXt4Y9PvvqHkFU6AcHRXAppM0DTCUEixJOdkSkvXnC/JOCTFtjVjH3MzLSOxDxmkXavSc0vfr0IOClsmjmDkSw7xBe8pikMJfR2MbQ683Ut/Cqa+3vuptVmrEhHiP/qUYXKDXXuhEYGpGzwkDACdldCrSR3FqOb7jtVRiCYOiyHHI6VWn 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 resolves an issue with obj_cgroup_get() not being defined if CONFIG_MEMCG is not defined. Before this patch, we would see build errors if obj_cgroup_get() is called from code that is agnostic of CONFIG_MEMCG. The zswap_store() changes for mTHP in subsequent commits will require the use of obj_cgroup_get() in zswap code that falls into this category. Signed-off-by: Kanchana P Sridhar --- include/linux/memcontrol.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 34d2da05f2f1..15c2716f9aa3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1282,6 +1282,10 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css) return NULL; } +static inline void obj_cgroup_get(struct obj_cgroup *objcg) +{ +} + static inline void obj_cgroup_put(struct obj_cgroup *objcg) { }