From patchwork Thu Jun 15 03:48:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhongkun He X-Patchwork-Id: 13280677 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 5F3C4EB64D9 for ; Thu, 15 Jun 2023 03:49:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF70F6B0074; Wed, 14 Jun 2023 23:49:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B81638E0002; Wed, 14 Jun 2023 23:49:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FA268E0001; Wed, 14 Jun 2023 23:49:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8A0796B0074 for ; Wed, 14 Jun 2023 23:49:02 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 529561C8A54 for ; Thu, 15 Jun 2023 03:49:02 +0000 (UTC) X-FDA: 80903601324.30.4A0A104 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by imf16.hostedemail.com (Postfix) with ESMTP id 9DCC9180003 for ; Thu, 15 Jun 2023 03:48:59 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=TR6OrR3f; spf=pass (imf16.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.222.172 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686800939; a=rsa-sha256; cv=none; b=P3t4sTivo7hutSjhUyeNJn6X0WWA8Gd/UivnL8YibGdBJ0QlcCODd7DrDTERTvvpfFIpyg BUUhetD7bggJKGwfTqX19U6kJA3+TlGwMDZ4q+z0mHYqiXva7jx8E7MISe/RdUEgIDI2xV R5unerJlYU/BlNRSETiVTJF4ggOLSA0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=TR6OrR3f; spf=pass (imf16.hostedemail.com: domain of hezhongkun.hzk@bytedance.com designates 209.85.222.172 as permitted sender) smtp.mailfrom=hezhongkun.hzk@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686800939; 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:references:dkim-signature; bh=NRjYS/ADH2rjGpNFpYFXCA45Do2mTCUsIGO3/Z8z6+w=; b=XzFg8291Wzt3SQEbicmIWSKJI+b/+IIBw3zW1vSjSjrj0zhQx2gdGHH/b+1yf4Lqh3ZDKA hn/X/EBxhnpcl6LhlYqDnY4k9rGyXsQv4XC3LpWxDWlwwjycd2OS+6Cht8XRmkseeQR+no O3bJ/CXrcb9lO7ItNpcifZiGcIDdO6I= Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-75ebb3d57d0so274992185a.3 for ; Wed, 14 Jun 2023 20:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1686800939; x=1689392939; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NRjYS/ADH2rjGpNFpYFXCA45Do2mTCUsIGO3/Z8z6+w=; b=TR6OrR3fFDYNkCl+qhYqAsxfyiD8kknZZjEleHF/oB/mIAtrHmUqxT5dh8hGkLm7x6 jETfLCXhDDQw3QbD/HPI3dKgkAtov4zpQaVmJPSO1erj3zR9xOsTFOp/lu60HJH6nsZ/ 4QyKhVFs6hTtM1Nv/n0pMN9cqjRyFBJ1twgQJkxpYVM0qUnn216Whur/qwooRbmn9AeT kof5U1V3m8rwug8zJXXUBQJk+6gYIZBF4L5DgmHRpFHd4qzoGdTpoEVL0cGg3oFV0vDF BLwKzNKm+0bR1j1KZrUOTSyLGxMdfiQRFInPi2+TrbQvj9I13/lac+ftr4xbOUYSQSGb ObmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686800939; x=1689392939; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NRjYS/ADH2rjGpNFpYFXCA45Do2mTCUsIGO3/Z8z6+w=; b=L6el/nodZzmZDEq70zONKykJ15ZGttf+LnjCGVfcWO0eV9mfcf7+D48DF+ts/4ugrN Ge39H60qQMY9RsAgiDWbNehS/a/t2P7tG0jDl21prI8UoGfFyUi0IJqo87qHqdrK8/hf bsQkmTMJTEt3f0DKHKDp9L3+UYJuBWI08lpFQyNFYUDB315gcfZKm/DkQ8iqUdV+hl27 WtKvw2CJG3HsqclX6dablYsGAnhxLAAv3q/e44E1Ftfsk8DlXkHAdcUrQDNfLh6MTfB6 NKnceKwvoucyQeyacvnK3lgsuQFD8K50v6UHDBWxoZJy3oFMtfVHHj7NbkLUL1LQbbrF ytug== X-Gm-Message-State: AC+VfDxTQRXGVL3rFVkXxavQFpgPX3AlToXLTY5vjTO6by1mxJdN7sWz MaGwWi54GLYrEq9RmtIzRhzRWg== X-Google-Smtp-Source: ACHHUZ76N8XpYmzFAvhMwHbuyElh6B1OPNzdSBFlDx7RhGFePCnX/L9cfOqNK5UXZWfPHlXbijOyhA== X-Received: by 2002:a05:620a:28c8:b0:760:859a:d713 with SMTP id l8-20020a05620a28c800b00760859ad713mr15005467qkp.56.1686800938766; Wed, 14 Jun 2023 20:48:58 -0700 (PDT) Received: from Tower.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id 21-20020aa79215000000b0064559b58eb8sm11012074pfo.154.2023.06.14.20.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 20:48:58 -0700 (PDT) From: Zhongkun He To: minchan@kernel.org, senozhatsky@chromium.org, mhocko@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhongkun He Subject: [RFC PATCH 2/3] memcg: export obj_cgroup* symbol to charge compressed RAM Date: Thu, 15 Jun 2023 11:48:49 +0800 Message-Id: <20230615034849.1361940-1-hezhongkun.hzk@bytedance.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 9DCC9180003 X-Stat-Signature: eay45bj9xcow84a9cz67mzc6ctep1eg3 X-Rspam-User: X-HE-Tag: 1686800939-195836 X-HE-Meta: U2FsdGVkX18ycQbn1Ef9x/TAOiU800Ki5eecKlufmmQaILdnHRoHfUxlIhgoKPpWYWWY79xQxWhoKu73GNDRzKo91kTLCx+g77KAq/YZzeNnH2NT9/WOK2sBJJlVLhWlKFA0fWQnQVc/ofng5qtLrTqGaIDaZwUDicjF6eY2OpNCu/+vxcHS2pABYPZq5azz+4FxR7fPVTzjr/banV9lavUtudS+9eK2JEvYIr/v1PQCuFCxZqSHo9ApW0Fc3kre/TdHvg+kTRDTOK76gCN8OXst5oER9XKJrnJKV1ZmcxNfu2M4XzqmiHgOW3QrLmsgddR2r2bKP4wzeVJFhwcp7u2aX+481FVbPx1kw5CS5OXe/i/E0j/CP1kEDZCuTf1XkzkUmbtfOUIeQGiJsOTzbuOPKOoUU9IuN8QCG0bjvKc3SzIPQ4YL0GJYckMV1iqbLOdnEGXfGxpBNd67fqoVkS7Fsb/3vBOOZm6YzCjaGixFZ73NHIh7hrsCj0BPSW9Ux4JMRP9eKuJz7qwAiyVjrTV9ukBPGGy0JPOcLVRsEx5AJZ8QJv2g0YPgcOHg3WigRtj5sfBQ88YOrmBBDE0jubYouH2GKYFPpxb6crqwIux9+/WIjf2fQmHT/tJ2vmp58A9lwU8BmWLmoQMYXy8XWO4FqbpgxrjMxaDK+7bycBM50rXS2woW/o6Wuu/KtuThtJm4j6mmhOSNEiysCVXT/Mh7yXXX5RvoYZE5FfAPBC3Ld87K6E2ftBqvBXb+9/0pOiVORmLwyTgeHPLfjqzLmUyPt8WZp697cVfeIy1Gdd1pQduYd95eQ3+vTCYe5+dGY7qXcnxShLbkef0sZ5ze/GKOjGR6FG7QFdiuFYhxBHdcoaOz6ClI+xlbP1t4ERVZBDm4sR5HCMwD28XH2qk1zCrzj4qj+Rr1CJ1KOpS3egHMdq7UgLCkY2xY7lZFzbtURnVDAhvSoEQ5u1wmBzR vf1/yK/v X7E0UBuJN++yqje9ddeR4CYbrsVsrToM+sEZfgJjip6e9kmoeSoKeyM4C+QmGy7Zg4v6d5nOaxkJJkZoHHuTmOYMRm11cdNq2Ti3S1PJP/18o8aKfAqmAYpIgRNiY32S3pUaW+jib5+bDMNe74RgrKsmy5ZfMVcvVuZuQXm2bUPNbwPwuCXmffpx06fobW9otMtAtAOJHhtI54xeH3k9VZAHeMc0D8BV9m9e0XOOiCK4Vx4XHsd/V+tc2lLrwVg7Arb3eWZL0+IDky1ZU9AKyAV32CMnlY+IEvsthR2cRuadhhwmT06u6JHv/ihfVW7Y4CsGgYbHX6r0KSIkJ8zAcRCc7bdQWwLjwoQ10hdMWdcWkLFYNeoPTrkrnw+bX1sccaHS8ghfIM2zlfbXP/aneCoBuYXm8HnpTHbNSHV95S6qpprXKbm8IsASEjHxFFMzvm4pBgh+jnsoO61U= 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: Export obj_cgroup* symbol to charge compressed memory in zsmalloc module. Signed-off-by: Zhongkun He --- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4b27e245a055..8ba93afacf31 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3064,6 +3064,7 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void) rcu_read_unlock(); return objcg; } +EXPORT_SYMBOL(get_obj_cgroup_from_current); struct obj_cgroup *get_obj_cgroup_from_page(struct page *page) { @@ -3431,11 +3432,13 @@ int obj_cgroup_charge(struct obj_cgroup *objcg, gfp_t gfp, size_t size) return ret; } +EXPORT_SYMBOL(obj_cgroup_charge); void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size) { refill_obj_stock(objcg, size, true); } +EXPORT_SYMBOL(obj_cgroup_uncharge); #endif /* CONFIG_MEMCG_KMEM */