From patchwork Sat Sep 28 02:16:13 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: 13814595 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 A16F9CF6494 for ; Sat, 28 Sep 2024 02:16:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0FFA6B0160; Fri, 27 Sep 2024 22:16:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC0276B0161; Fri, 27 Sep 2024 22:16:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 987896B0162; Fri, 27 Sep 2024 22:16:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 790196B0160 for ; Fri, 27 Sep 2024 22:16:26 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CD51841703 for ; Sat, 28 Sep 2024 02:16:25 +0000 (UTC) X-FDA: 82612532730.06.924143B Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by imf28.hostedemail.com (Postfix) with ESMTP id 2907CC0007 for ; Sat, 28 Sep 2024 02:16:22 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HwjscqaT; spf=pass (imf28.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.13 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=1727489721; a=rsa-sha256; cv=none; b=KlQHncESCWPxz4pBaiDOuU/2hcHcS7DzvhdXhxvW0sYI3S6ZRkm91L9iEYmLea+0wSEXIk qX6Ex/BaUiIWxrDo/yWYlh2x+4nIkCiK1P97y9wJlwz1RTIHZSAY5XDuU8WTQJU4gSvvmm c1ceWOhNyQ1GBrG9C5N8w3Z5ioWNEBs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HwjscqaT; spf=pass (imf28.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.13 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=1727489721; 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=8r/G7MZvN9qcl+J+6KV629nhwO4Bq0Wpq1eduKQLhRA=; b=XMHqmlz9q3ksN1sqrurzQcxuo6BKJoCAL+a6hxGEznSO0bfEL2lM8VHrwaSeSQnO6/a+N5 ZRQBHnfLv13P+CXU5/vEknlIfeRNUyVkujnLUi5SYmjnpOlwp2VFw59Kre2xW3+AKvey/I G9FPTkOEJV29fpTdllGudFHieRnPB40= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727489783; x=1759025783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IbCXass7UYncWYJbpbqgopMF9OvpwOCCnOnS4dLfg9g=; b=HwjscqaTMrfU+u1NQlaj25JpzZgJZiFdABiti8EmjvZWDz7hignPmMp+ RNGwRqRxB03sjjf54EC1Q/qk9Rfjd7hhRbjfPLdV7THQvAWsB24uG4vf9 ZfyYmlZRTe5ZYouzCSys2dOZU0BNR2ikGzuNRMeCS80u2EMMKc7iyXF+a GrVn3MkxnkBrM5oGjpCSiGxrRmBdircpa69pBeN5ev5R6c6bHwPQCF3oB HosrPT7D6yI3m4gaLECnRL1VibbJNAlWThVkeQQx+NAJpff3AtZwpfnnF Kj7/k5DH25WHsNLnpVN9HXcV9kxMy9sEDOblfDqjbMjhvvJmrbmjQ1OxZ Q==; X-CSE-ConnectionGUID: m+IIceFHRvOaW8d2W2S/Qw== X-CSE-MsgGUID: MYckJ+U6Qj2KczXVdh2/jA== X-IronPort-AV: E=McAfee;i="6700,10204,11208"; a="29526865" X-IronPort-AV: E=Sophos;i="6.11,160,1725346800"; d="scan'208";a="29526865" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2024 19:16:20 -0700 X-CSE-ConnectionGUID: 7MNZVH/3QTSILL+XMnuEgg== X-CSE-MsgGUID: oL3sghaCRXW2zPSVQBV2gQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,160,1725346800"; d="scan'208";a="73507110" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by orviesa008.jf.intel.com with ESMTP; 27 Sep 2024 19:16:21 -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, shakeel.butt@linux.dev, 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 v8 1/8] mm: Define obj_cgroup_get() if CONFIG_MEMCG is not defined. Date: Fri, 27 Sep 2024 19:16:13 -0700 Message-Id: <20240928021620.8369-2-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240928021620.8369-1-kanchana.p.sridhar@intel.com> References: <20240928021620.8369-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Stat-Signature: o356cnpuaofbdmze43migtkzitwj8ccn X-Rspamd-Queue-Id: 2907CC0007 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1727489782-414771 X-HE-Meta: U2FsdGVkX18NZCMc/6W5zJoX3ymRIEO5e3+LJJNJVNoFj8mQFGCuioROB0ezTdKEwnH22ycW219bZKeZFMCBfZR9TRGKXT3zzxR4AmE4XjRGHEknmbDfY3rdmL2VqJ7T0Ig6Vwg1cZ/xj83A7HGn10U400ko833SdgtzCEWexQsvj1HpQfShYrLSAZGCiGntSgTZ/uT3lkrtjLC5S9EdBAIm5LDGkml/iR44hgJHPcIfLpSvhNLfsjWi60L5fX7+FdSJ6xPkMjTbNb0iVP5+tFh/WpY0uLuZ0A2AGGtiIG92xUxjDU+zwHc1OcVewuNnjhdvmXc1FTi2Wo/u6wgjkiQTys5Ll73pqyin6m7Ovo94bVpdnHlwqBOoSV4ye6qJK90n91iD03w/u9aJnOHGfzQEyrKVv6u8Uxd+J8SibZbNOta4ZB5I4yw/2s2caHen35DyzHKXUUVmZXCIrT2G/vIeKzKgDjIlOcI/Cu6joDR2bj2U5wUdzroyGaeIOjq5k9btaw7njeXTNQqtFkbRHTeys1inlga/opfD4TksDlZC2w8hQ94gNmNY8/ii/SZp6KSS058vA8HzxAXgFyPGiwwwddzyKf0J3NPU85VXFrM8o28g+6Gx09RDLx6FSFtw3/3NOJuPYFaHL30p0Yul+mHp71Q4pxURApbicgekNCU9EjVIyhr1wrGS7W5BlVGljyqzlvH7P6fAqTX0EffkQhHR/I8h7qBKnqS+ETA2/9mAxf7NI3oCfrTmCtST/4LjVEhsDcRh2+VU0ukTUr1zW9nUOMDu1VYhxTgbZ3c9fKDQrcFIV8OEWdV2qSjYFxo4LZSEjGZkw0yxSAl4uo0WpJOyzaICERmQUatXGPJXOR7fACZNK9m5l9tizfyAVU2TmnrCiIUwIzX51ZVr2r0FkfdytdmQhlh2vm9om1Crpa1k3NLOYOtD2t0TSlIQmCqX7XPcQ3YhRvNPXuQCKNA z2QmaP94 xB3pCI1X9U4cMgBrSodJMv3rKJ0dHUqplDkQksTqUReIn8EM64G+Ds0JbZxO8Y1VskhSgZHFhIrMYd2ziutK5eSTS/IbwrMeGuroq63NLaovyLxgKrgdSFQKxUAfj63OjbOkSLUQCZANnSh0puHEFEXr6T6uO4HbXQxmmUlBnF0D6JK8Cg1bVJ6kycoGBVfm1IwqMswvtqvRQ8UUX4uA3KYzZ5PuNJGjnjgiJHwQdD1QNlFIFhHjdo1cngw== 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 large folios 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 Reviewed-by: Nhat Pham Reviewed-by: Yosry Ahmed Reviewed-by: Chengming Zhou Acked-by: Johannes Weiner --- 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) { }