Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp167230rdf; Mon, 20 Nov 2023 21:37:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF30oOrlDr7ffh3XgGvHe4oMXt0+2wk9wOdU+cQNrL/+jSik1arR+zovSU5R/CvrrvB0De4 X-Received: by 2002:a17:902:e80a:b0:1cf:669b:613c with SMTP id u10-20020a170902e80a00b001cf669b613cmr4042148plg.55.1700545034546; Mon, 20 Nov 2023 21:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700545034; cv=none; d=google.com; s=arc-20160816; b=FxClphNusRVxB9jSRTqZFtyVKfaAjgrlxCsb6Mw9t270+vxNe7gAPqImHr2OIpQfGL 57uSiCJNtLuNzHRNJYYHRp+F1fednjwPe4qQtaHHLUA+LWObtPKbo/j7HsUqDzswglvh NhTjNYkl0u14wFAEQ+TkOF+SRn9T2X3Q05KP4GNQ6b8TxBrgeUNNhbRCJkF4umLU9iJt 0X3fpWhCrdK7+sGHYXnk91uWjRDTc4LEKBcFxiXuOQzAzJpZvCJ2f6Jij5C/a8q/FzhW g6Y5a2mGYLf/piMfog2FDHRnKZCYMoG3CFtgnCDtYHKsYuyaGnZXatgLz7tyT1h1YgmQ ij/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=7EhJsRwMoOMIYMl/nZiPuFFK/qggUG9M9CeZZ4vHDL4=; fh=vqNpWvtrgKyqgLywmXrl7l1d0QUXOIwW93A3X4awQbI=; b=K7D/CIOGMCHqyA2emhmnFQTGg8mg5j4dSrnTLq3E3JLoZBPuQNZ+vFt9l+mq9o0vO8 BqcHoKV6IzCvpTrchF2H5i/HBPeiqV6KkVAMtYEBryBSs66ZBez3pouGYxcOltH7MUq/ VPA6dD2I5ZK2sKPLfbG6/32SAJo4zfhkKjeUvsdqdeoZU4a+KFzV3UMf/lY9SSHUWRDV mdSpqtSYQlDkgxuYmLYtfwvxZmZ3m1cr/6Vev2ShzQn41x8H7v3OUbpcTtaKcesUQcn7 JocOdt54Muo9zl5cBCHq7cwP8vRCoaBgekLlbRTy8VNqiDKSfhtMreJsUkGtj/qdzvdp uTSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=D6nVWtz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c10-20020a170903234a00b001c78345f376si10281871plh.241.2023.11.20.21.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 21:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=D6nVWtz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 7B401804081B; Mon, 20 Nov 2023 21:37:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233438AbjKUFgo (ORCPT + 99 others); Tue, 21 Nov 2023 00:36:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233510AbjKUFg0 (ORCPT ); Tue, 21 Nov 2023 00:36:26 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1807D45 for ; Mon, 20 Nov 2023 21:36:15 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0C87C433C7; Tue, 21 Nov 2023 05:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700544975; bh=2hTiZxsT86X0oN/PSearw+dfIAhh29V867VL4eOG5r8=; h=From:To:Cc:Subject:Date:From; b=D6nVWtz74Snj6LQsOZed22kJrcYfOOgYEzM/3i+YkHfCZmhauAJx7p3sCWPmkqUZT +S9RB1X3HAlZGSQDqQkt+IoQZRP42JQxD+10JjolCfxKyMMlLFN+ki6Bu9mHIQpXWi McBkhAlEdsTrUaRbTH1lyXmWGsnIz55tK7TJV/xaTgoWXb4+SgZG8vweCqDFIu+Nvz tZ5dfUYZB+t+Nz/tP+1c5ttoqjr3pS0g16ro3IabH7HAEcVvhddyzfiuAuNYakoWcB 5CTdxJsyMsfdPoT/fbyZ+zd76mKOiq9+q76NjH/GbN+xZKAJswD5ufN9CVkvsPks8B OokXxU/mf8+WQ== From: SeongJae Park Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/2] mm/damon: export DAMON symbols and add sample loadable modules Date: Tue, 21 Nov 2023 05:36:01 +0000 Message-Id: <20231121053604.60798-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email To: unlisted-recipients:; (no To-header on input) 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 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 21:37:06 -0800 (PST) DAMON cannot be used from loadable modules since it is not exporting its symbols. This makes use of DAMON unnecessarily tedious. For example, we presented basic usge of DAMON at kernel summit 2021[1] by writing simple loadable DAMON application modules in live. Because the time was limited (10 minutes) and the coding was to be done step by step, we had to make a downstream commit that exports DAMON symbols. There were users asking why the source code is now not working. It was mainly due to the absence of the symbols export patch on their tree, but also due to the changed DAMON interfaces. There were also multiple users requesting support of loadable modules for easier deployment. There's no reason to avoid exporting DAMON symbols. However, it would be better to have concrete use cases of the symbols in the tree together, for better maintenance of the interface and the use cases. The kernels summit 2021's live-coded modules could be used for the purpose. Expose DAMON API modules for supporting the minimum modules and and add the kernel summit 2021's modules that updated for latest DAMON API under the samples directory. We will keep update of the sample modules. For exporting more symbols, requesters would be required to merge their modules using it in the tree together, or updsate the sample modules to use the newly-exporting symbols in reasonable and still simple ways. [1] https://linuxplumbersconf.org/event/11/contributions/984/ SeongJae Park (2): mm/damon/core: export symbols for supporting loadable modules samples: add DAMON sample kernel modules MAINTAINERS | 1 + mm/damon/core.c | 10 ++++ samples/Kconfig | 2 + samples/Makefile | 2 + samples/damon/Kconfig | 30 ++++++++++ samples/damon/Makefile | 3 + samples/damon/damon_sample_prcl.c | 98 +++++++++++++++++++++++++++++++ samples/damon/damon_sample_wsse.c | 80 +++++++++++++++++++++++++ 8 files changed, 226 insertions(+) create mode 100644 samples/damon/Kconfig create mode 100644 samples/damon/Makefile create mode 100644 samples/damon/damon_sample_prcl.c create mode 100644 samples/damon/damon_sample_wsse.c base-commit: 79cc930e5e3dc73c972d9e422b5e2ab3fe56dce5 -- 2.34.1