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: 173673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3173022vqy; Mon, 4 Dec 2023 18:30:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5bsTGpJUK6VzIbXnePu/OmNO09OC73MW5lOIm2EDz2wKB+gMavFPGZJXXpsrMGrd7yO6g X-Received: by 2002:a17:903:5d0:b0:1d0:700b:3f77 with SMTP id kf16-20020a17090305d000b001d0700b3f77mr748567plb.49.1701743404325; Mon, 04 Dec 2023 18:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701743404; cv=none; d=google.com; s=arc-20160816; b=SqSxNaES4zUHOfM7GNH7V0Conl0vgDsvh7KVg4fFlhZ1rpdhW6SDtri4YgqZUIkaca hRiJijx2ZeqMTk1XoBNydnhOc/cZn8PhuFUKAYwIS3Q8ezKu2rUrl+HR7BBqw1mHADm4 tN9eTFYpHL/DR2Pr5J6E/WWrTzjCQC5f6IEcwDXFzQj7uFY1+rmL3d5dhNaLalLpfLSP jiYn7rTE6q/H+1n/H+iXl89D+sOhWoI2JzyVLfKxR/2dX/rkq7re+o1QDDyAnWUc5ff1 i2ST8+ieGEAke9ZdJ5ruw/iuPaGgCiRqHAFj/Wxs6fzPqXXwNSFWa8WsReFdwJtGiU2R fRcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RbnZDQn17mlTBLITgMkCXl6q3Gb9LyY0eTRhgOneHZA=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=hirFrSZVrxyLeEx6aOXxoBxtpiirJopZZeVAJgdmGZVK0oyIJGKHUotm3bZ+XPS2Xw 3XsBRp5sE7uCO0Df0GfFs8cGe2ZwocfOJ1Eo8AvdGQ6uwKq2RS671PoLk4VdhRds093P BR18xMXIO0V+kXTr6yh7Z+Shm1hXDveQgSoc4s0rWH4EiRTOGFF5hLc5IHreO25lWRQf UYyZ3aOoVZG6LglXOjeFYXn/9HssdfJQxYSXYmBbR0Y2iBwpfP+CFuURnTLTwrat909T fFdfAF17cU7PtLxC3N5UGVu8vBpGjXCuJrBU7/4BxpBUcRTbTKWx+pxXtiZY45QlbD6N 9C2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J6aY+O82; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p22-20020a170902b09600b001d00ff4bf6csi8506816plr.466.2023.12.04.18.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 18:30:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J6aY+O82; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 754D280781E9; Mon, 4 Dec 2023 18:30:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346426AbjLEC3y (ORCPT + 99 others); Mon, 4 Dec 2023 21:29:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344107AbjLEC3l (ORCPT ); Mon, 4 Dec 2023 21:29:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F820124 for ; Mon, 4 Dec 2023 18:29:05 -0800 (PST) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 18:30:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784407292049438513 X-GMAIL-MSGID: 1784407292049438513 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).