From patchwork Tue Dec 5 02:28:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13479310 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 EE6BBC4167B for ; Tue, 5 Dec 2023 02:29:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83F7C6B0080; Mon, 4 Dec 2023 21:29:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C85D6B0081; Mon, 4 Dec 2023 21:29:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6907D6B0083; Mon, 4 Dec 2023 21:29:11 -0500 (EST) 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 58C136B0080 for ; Mon, 4 Dec 2023 21:29:11 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 350231A03CD for ; Tue, 5 Dec 2023 02:29:11 +0000 (UTC) X-FDA: 81531182502.06.41A4027 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 140BD14000C for ; Tue, 5 Dec 2023 02:29:08 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=J6aY+O82; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701743349; 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=RbnZDQn17mlTBLITgMkCXl6q3Gb9LyY0eTRhgOneHZA=; b=MW7fICwQOlucANLr3EuTnac0t69Og+s0XGTYxK08kRUlTvwJRTdDMcmLA6DK9998QdeGh7 Ey3ed7sOxuGiTa4UNqSY1Qq1dv6vL/r/+bAEegXB8VfYEiZqGA0qvPaP1OEVwFLfZzwAg2 ZFPa/6gThkFCFU1s8xWSFTyVL+hIqIE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=J6aY+O82; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701743349; a=rsa-sha256; cv=none; b=8hFq2sQsXOU1E5pgmRTeii2Erx4TA1/WKQJ6Py9fOliSUQhJwKSycS6FKr/oOQ/VBf85GE VJbBPS+GLKEv32Y3PUrYsgjiEQEBBZVu43MwzZs4ES5Rl5iGSDRan4SCOohmFODrpscFw5 5/rQfaAH38Ws9em/NxhRT6cnhViOFcg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CC286CE1400; Tue, 5 Dec 2023 02:29:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4127C433C9; Tue, 5 Dec 2023 02:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701743345; bh=hl6U6OugfgCPU2deKjlNge8ZmSL6lB/DjRx+v2yMHcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6aY+O82JRLvi9ZiWWCgNK9dzhk/rfbzFntuVc90rQCW/Qz98hD+qf1B+yrS8lvYu XUIDJKNblYxLPqmArrgtOb4NxmUhlPnUNpFSomqcHGzLHD5JVDiUduOhmugOvLbPuG WXOEHM3IGOGqXhKGrZP+kJjf38+ykbHuleoo3E2+2yRd/8nRjGgl0uDINgj1OVDnk7 fTsDY58oxNXjT2WKpZZNi8iSjrAKre/9np2NhgNBqh9iA11U2kLCJMxhTbSk7qKbNk EjaY/ejgRFM9qz4Bh/64/9Hk5OeEN3dcCKJ8PT/UHgvKQ6lFDxvOOsNwUmnw+bC2jq FLJrF+YB+LCKw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] mm/damon/core: export symbols for supporting loadable modules Date: Tue, 5 Dec 2023 02:28:56 +0000 Message-Id: <20231205022858.1540-2-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205022858.1540-1-sj@kernel.org> References: <20231205022858.1540-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 140BD14000C X-Rspam-User: X-Stat-Signature: s8n7k6icsxwzciks1spykugfrjup1iqn X-Rspamd-Server: rspam01 X-HE-Tag: 1701743348-32119 X-HE-Meta: U2FsdGVkX1+iqwMJKIoagPpSXI9PF+RZSyvmGOFvwl45wZsfO7pnVQgK7ehQqWYpzaR/B9BFeXU+MDTBP2vW7lhJ33MNO1c6rmaQ8VkWeAjGnsFe/rnbjMRlRqGm6TBjXekGy2Fru6JmVpJRHHCLVPs6s1V5/LHB5PMGsE8TezNtkZ7c4qYXUGANGqwPU4BNP8g6pTLatGdzTlkHuqc1Deyh2FsU5FZDJIGdTsUfXSldiUDWYQ973jx7U+Lh52PHmpBd722UNXxIJixr/jmB4IOFroBRYQFiXGCftl1XqOsmHJxMCQ6pvUs3ZZYz3nBmrom1iFWqKkb9zFmvAVMzvoT7yC9NHAqBRkwV0KQ+bcxipV6R92jNcyOUnwS56Y0T+R4a2bschuKmWz52NzYo0ZbXUhJDr6dkWogHb2/+cKAP6jyk0cG647T6b+hHKlBM3WxHNQ5rz0QJ2N1VRlT/exUCN8nK+H5kvg5Jr7IbhAJb9n139RLmRPZlphkgm/+zpbFFvuqfN/Rtwdj5eiD4TL/opfC40BwAkVYPPGG3mVuHhXSg9E0y/Xqpxx7TMiChwxcuWyfKwuwARUwnHertIp+xNBRPSojvORa1ZYJp9aT7Hf63azlQmvsXkOsQeZTWFWGMFUpbPXYLaUgwMxhh8vC34W6l0s4adzcPuJICv0rmBrGuMvbUPoPKT3iAR/CxoKwhlSSH58ESCsY6RrRm27OVJefz2/HW0UKt82N2BuN2DhZJyoxjiUf8I2Q+EcTGVzJIoMrxvnb2CZ5fqOfK7bdE/vN6AORem+mPVWdWJ8CLKAOEr65fdKEhIQ/No+VRS3yVFAuolrVbqZisahiHjWp7yX0c1WumjWxGLl7Fw912W8/GgY6Eo+Hxtp0KXBBSwT4WRAcbcGS/rwQPYsAyHnR55jp+Btbo3/PqT/lGrVusmxrqrslzzyuIPmgNplARTYDZ+5ZSO48swxF3zqs F9nRkIxY sHB5hKeYM7SHd565t1ltg2+iSRuZhyCgz3AxvioQVoexE+b88SiwE+M/ruda4GTYbZCo9cmVpt15zohItZMsbu4q+MwWFEamkLEhdTJsDUf0MGmqnr7pYSVF3s7w7QKa1+DLySrBR9ZIUIUSPrjED0QebywfpCFYm1VxPSNIkbHSHWQfGFpXHjfd9hd1W4EDiw+HlOLH/P1tczXNS0UNT5bx++spKCV2HS+IX29yZ12Wbp+Y= 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: Expose minimum DAMON core symbols for supporting use of basic functionality from loadable modules. Followup commits will add sample loadable modules that use the exported symbols. Signed-off-by: SeongJae Park --- mm/damon/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index f91715a58dc7..8a5c3e905738 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -111,6 +111,7 @@ int damon_select_ops(struct damon_ctx *ctx, enum damon_ops_id id) mutex_unlock(&damon_ops_lock); return err; } +EXPORT_SYMBOL(damon_select_ops); /* * Construct a damon_region struct @@ -343,6 +344,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, return scheme; } +EXPORT_SYMBOL(damon_new_scheme); static void damos_set_next_apply_sis(struct damos *s, struct damon_ctx *ctx) { @@ -380,6 +382,7 @@ void damon_destroy_scheme(struct damos *s) damon_del_scheme(s); damon_free_scheme(s); } +EXPORT_SYMBOL(damon_destroy_scheme); /* * Construct a damon_target struct @@ -401,11 +404,13 @@ struct damon_target *damon_new_target(void) return t; } +EXPORT_SYMBOL(damon_new_target); void damon_add_target(struct damon_ctx *ctx, struct damon_target *t) { list_add_tail(&t->list, &ctx->adaptive_targets); } +EXPORT_SYMBOL(damon_add_target); bool damon_targets_empty(struct damon_ctx *ctx) { @@ -464,6 +469,7 @@ struct damon_ctx *damon_new_ctx(void) return ctx; } +EXPORT_SYMBOL(damon_new_ctx); static void damon_destroy_targets(struct damon_ctx *ctx) { @@ -489,6 +495,7 @@ void damon_destroy_ctx(struct damon_ctx *ctx) kfree(ctx); } +EXPORT_SYMBOL(damon_destroy_ctx); static unsigned int damon_age_for_new_attrs(unsigned int age, struct damon_attrs *old_attrs, struct damon_attrs *new_attrs) @@ -616,6 +623,7 @@ void damon_set_schemes(struct damon_ctx *ctx, struct damos **schemes, for (i = 0; i < nr_schemes; i++) damon_add_scheme(ctx, schemes[i]); } +EXPORT_SYMBOL(damon_set_schemes); /** * damon_nr_running_ctxs() - Return number of currently running contexts. @@ -719,6 +727,7 @@ int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive) return err; } +EXPORT_SYMBOL(damon_start); /* * __damon_stop() - Stops monitoring of a given context. @@ -762,6 +771,7 @@ int damon_stop(struct damon_ctx **ctxs, int nr_ctxs) } return err; } +EXPORT_SYMBOL(damon_stop); /* * Reset the aggregated monitoring results ('nr_accesses' of each region).