From patchwork Tue Sep 24 01:17:02 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: 13810014 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 6719BCF9C5B for ; Tue, 24 Sep 2024 01:17:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFB3D6B0083; Mon, 23 Sep 2024 21:17:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C84BA6B0085; Mon, 23 Sep 2024 21:17:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFCBF6B0088; Mon, 23 Sep 2024 21:17:18 -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 9497B6B0083 for ; Mon, 23 Sep 2024 21:17:18 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 44BE9121632 for ; Tue, 24 Sep 2024 01:17:18 +0000 (UTC) X-FDA: 82597868556.26.17B2034 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by imf08.hostedemail.com (Postfix) with ESMTP id 1E4CA16000F for ; Tue, 24 Sep 2024 01:17:15 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=e9pGbf80; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf08.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.12 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727140601; a=rsa-sha256; cv=none; b=G6S2JxpBMu9iMpM1OhWo8iuSmY8HwYHEXEkFEGnpWCTBtk4+dxmtj1KFpJE2ZhKQCy1PeC 8uIWSoSfG3tCEVad23jeH+R6c9hL38NA/zD9CD8WQzTYcZFl4PCrDL92UgIMih0HENKbG0 6kOE97JfvVGi+TNMAFFvu3PlZShR3EM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=e9pGbf80; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf08.hostedemail.com: domain of kanchana.p.sridhar@intel.com designates 192.198.163.12 as permitted sender) smtp.mailfrom=kanchana.p.sridhar@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727140601; 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=zX8fQhC6OG86zT7XtJPIGWvz238x7tItCtdZAG/EMSapmKgXAMJ8I4se9IWSa27fbh3S0t aLfIO7a/oDZ/Jmq5OWeYfnvIuQrVYWYJfLqo0cYDPHg4kudB1rzrHW8HVYHc/cWp1ssAcC 7gleoew5h0klirF+E/veql3ydTpgLIE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727140636; x=1758676636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j6MRHvvdb4Y/ecSm2gb8TOi+Txe+Ci0dZeAdkAYjrOU=; b=e9pGbf80ybSGnqqKH7hXp7D252lqR+1mFXcNCkDvlHMuY2+TL+nl7X8W HGKzvw/H2PvAVGZh2M65pf9JCHUdaQqetq3zFjSmES59/LQIVlC1J2hwb MadBIcJ3YeZnfMtOqEs+nS/Oht7wNNVy7ZCCEfrWMq8tgRFpyPPLf09HU hVMXj6Ht9PZJunXEfpaYPpGO73OHr069x8lu4IoClOX1zsgvataTXV7wj E+U+RY87q8Zv2+N7iuLVsFXR+b+bj6WUQ5alIFkFQQ9kTybIdR2ph8Vnp 5zL+VWAlD1pXCdmVDVTNW07CY7LuclSarEBC7A0K7bKLXDC2H57YTN1tL Q==; X-CSE-ConnectionGUID: 0FdE2+7uRkWsVlytI8WBgA== X-CSE-MsgGUID: crB5hP/FQdyVOkAtP0H6LQ== X-IronPort-AV: E=McAfee;i="6700,10204,11204"; a="30002001" X-IronPort-AV: E=Sophos;i="6.10,253,1719903600"; d="scan'208";a="30002001" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2024 18:17:10 -0700 X-CSE-ConnectionGUID: im59xWO4QgiDbIGKgbJwwQ== X-CSE-MsgGUID: mRXKs5anS0CqWg+gbdX0Xw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,253,1719903600"; d="scan'208";a="108688443" Received: from jf5300-b11a338t.jf.intel.com ([10.242.51.6]) by orviesa001.jf.intel.com with ESMTP; 23 Sep 2024 18:17:10 -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 v7 1/8] mm: Define obj_cgroup_get() if CONFIG_MEMCG is not defined. Date: Mon, 23 Sep 2024 18:17:02 -0700 Message-Id: <20240924011709.7037-2-kanchana.p.sridhar@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240924011709.7037-1-kanchana.p.sridhar@intel.com> References: <20240924011709.7037-1-kanchana.p.sridhar@intel.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 1E4CA16000F X-Rspamd-Server: rspam01 X-Stat-Signature: kzeaktxtsy98wb9uw1k84hho5ehgznqi X-HE-Tag: 1727140635-96821 X-HE-Meta: U2FsdGVkX1+v+CvanngSybaerWbh5p/vEnHclK0j7xLPPk2Y/igzk1DWxeSq8YPIf2K67mXeHZZ8wFVACVYFNhg1WgeFPN/wSTwT8SpBSlqJEA3DnWXoRdogbzeAjp/9VToHvk/G1bOB0HgYWNg4w/Y83UQYUJMrsQA8NYOwwSMH1/fPQ0StQ93mEpyv2jJVi0BHaVMylsJBCH8cxUf5UAPXhCEvu+QSmi1QRJIVun7W9SGQJw7ZnR9Z2JueRmTfG8MGt33xWL1Q/IXmp35P/hFzg6czzy/YgH7DegFT1t94YReUb5KbVCfhgMNu8krwIi1XM1ATI7vd0ct2JIx4h2qJQgbrZyUWMT/NAFOZeKTCw0p0CFdvrWiHPJUd6OrsjG+HkeRXbgTeHbOJKHYl1DF0VxKsz30U8T5b2xg4KEWJJgunfbBkHpILS0VuzgrE+XdVtsKCMbpxck55xie89Pq+JSMY9Qaxr4pLyEbrKn0WT27tmL+uGI4U0tcoRwkc49wfvUwS1i4RWzIvn4HI8yzRidiPpG9dtE12pluNmMzQySio/IYpLtYiCE4plfpf/DjNPeHd1B4+EdKU+3AwZ6Jc0IkCdZu8IjIuzWTUiICq0TN9AKZOLeqcXLJyD1plPGyTPRHN9nrdGkxnydkJ6wZXgfnIQRMqXMg8xRHj73MYeAFuFvrjdltsgHPOIbbQ29faUX5n5AQwXIg0q6vHxMFZyFjUh4X4isRvXiexCTU0Qbix42JlueHEU/duJhWTFrn6XF8H8bxF20equaFxaaUz0bjjWJ+mIXmRw+9sLg5FEeY2Zco9kOLtomZJdwQpbq+wuVycBvDaPfrjYkoVWLlqi4HQlFDf1Yifqa12DsPSc6rw9C8rVKzSgJnVRm49k9kpvYGMkDLyX1r9ftqJnC3BKvF01GTHAonKAmZMC030lfX+Eq1dcmep7G/t3ozCxyTbb5KvTczhaK9QTyV j/4HoqTj I0icVpPlvfLWNpgwGOP252udV5YDSBHwt/qHGF1Mb/xrLKey2LWG6FUcBdbzX3fjd5Eb8AJkexG/KdyCTqjW+OFXIGvTNRAPIeCg52U04Kx7KoEIzebQGDc4U58ggC5DzoTEbslAloiJfHf4prjZglFSBT22wOx3Us71SkzpA1TRw2Lvm9exi3rtAqTxkp5GsnMq7SUc8ODPUrd/zctlXfis7ZucuG8L4X+sFcHll1eixuY8= 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 Reviewed-by: Nhat Pham --- 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) { }