Message ID | 20231205022858.1540-1-sj@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3173055vqy; Mon, 4 Dec 2023 18:30:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWH+yDVyw4u6SSdrM8EyeZmO6Mo1HY2ZieEFsdfCCCE6fIuS+831JbWka+XmfpOWA3mBHj X-Received: by 2002:a05:6a00:ad2:b0:6ce:2732:585 with SMTP id c18-20020a056a000ad200b006ce27320585mr665191pfl.54.1701743409254; Mon, 04 Dec 2023 18:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701743409; cv=none; d=google.com; s=arc-20160816; b=COgWi5rmrLPeTG3a2qvLJVu6JZM4kbTKe7aHelLAUx910FimPdttKgC10A35RibUa1 rZeZ1RMAyUQGdy16sY/QJWv96HVFVFgn6ACovjTIJho/Ns1RU34egVR0QAHoETAvHPXP f1/pZ8LnwmZAVlNcbA6xgZAi5cEgQZRaNb3KmoeDeeMoYtf4UXz7+JGdo3x7bD3hqr5z DWQl7nwRzwtCyR/DBHQ1Pngz25ozbGraZrCUjG/XFNn93Zgf6Y5BTPqMSF+aghgUympE TyCo884pWsRKqtLwP40Bv5fsAW+9dQjsHMn8c6Im8Y2SEFimcUD+rn49fmi9hJW0DXYo GihA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=PrQZKAOIrUCwkEWGi/daGN8QmbcyYwfvjJm7NHr6iDY=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=X+4nFxBMRluEWwIOiFP+xHJNPVTxCVoJMic8+B6UnZyF2sptmBCc1NfX5nC1Mj7D8/ 1vIMvOgJJijcLVSWK9OAHYddzX6jUI6XvJ34fGA+6XDICkJjfiQmajB2AhmvQeZo+By8 05D/tKdqE4Rg1M3BPY+UDtDXo0tbPfPsB0RfyUm0dE7nA+TjNTiptr9rva8PWD5desfZ a83QUVwHu7VKEEUXRjC2GUu+OeT7+e9jrIAL1acGVFShfPaSXjlLP/dmO37UT2AgaToo RardrRcF/JrdL7xZpFI/61tibZXxuJE11jR2Iksa+cdA5rzZX4bAP/Ky7Pczm/MNu3c4 Ihmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=czDr4W1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id q197-20020a632ace000000b005c625b9f61esi8535626pgq.779.2023.12.04.18.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 18:30:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=czDr4W1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 D524380B231F; Mon, 4 Dec 2023 18:30:07 -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 S1346468AbjLEC34 (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Mon, 4 Dec 2023 21:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346415AbjLEC3l (ORCPT <rfc822;linux-kernel@vger.kernel.org>); 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 44D5D119 for <linux-kernel@vger.kernel.org>; Mon, 4 Dec 2023 18:29:03 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E64EC433C8; Tue, 5 Dec 2023 02:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701743342; bh=WXN01WmS/1XYD2UM5/KTAA43TQV3rGLcmc9JJYlY+Zs=; h=From:To:Cc:Subject:Date:From; b=czDr4W1jJnUWy8kd3v9RRDgKXCXocS82Li0EGVZit+a+g8qXwzJK/05JuPU5p59uI mNL2MrdBevaxzcFe9SUk0wJieUBy2sg1eSkmpmOIA0Qc2ZRfkWt35h1cPGlJ69yRzW Sx9+/Cj13S5asDVBKZxroJPRmcx9LxxB2cUxHQvTPTgS3xFmZYnoGexnc7epPeac1S iThTWc/g1gGXleTQnCfBmYbFlU8i2+W1zghE1o3i30AaHfFXLgAEqusK8USGTudlis 8/qlW4IkjWwilJQPhgrS73lm7aOE5DVGzPtJDrSMrCKjSD/X5JpHTufF3EgT47HfKN V0zZDLnwstUVw== From: SeongJae Park <sj@kernel.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: SeongJae Park <sj@kernel.org>, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] mm/damon: export DAMON symbols and add sample loadable modules Date: Tue, 5 Dec 2023 02:28:55 +0000 Message-Id: <20231205022858.1540-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=-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: <linux-kernel.vger.kernel.org> 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:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784407297508219915 X-GMAIL-MSGID: 1784407297508219915 |
Series |
mm/damon: export DAMON symbols and add sample loadable modules
|
|
Message
SeongJae Park
Dec. 5, 2023, 2:28 a.m. UTC
Changes from RFC
(https://lore.kernel.org/damon/20231121053604.60798-1-sj@kernel.org/)
- Wordsmith commit message
- Use GPL v2 for Makefile
- Separate patch for each sample module
DAMON cannot be used from loadable modules since it is not exporting its
symbols. This makes use of DAMON unnecessarily tedious. For example,
basic usage of DAMON was presented 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, it 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 updated DAMON programming 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 add the
kernel summit 2021's modules that updated for latest DAMON API under the
samples directory. The sample modules will be keep updated. For
exporting more symbols, requesters would be required to merge their
modules using the symbols in the tree together, or updsate the sample
modules to use the newly-exporting symbols in still simple but
reasonable ways.
[1] https://linuxplumbersconf.org/event/11/contributions/984/
Signed-off-by: SeongJae Park <sj@kernel.org>
SeongJae Park (3):
mm/damon/core: export symbols for supporting loadable modules
samples: add working set size estimation DAMON sample module
samples: add proactive reclamation DAMON sample module
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 | 102 ++++++++++++++++++++++++++++++
samples/damon/damon_sample_wsse.c | 85 +++++++++++++++++++++++++
8 files changed, 235 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: 7fcebba4a540e4508b923f00a3e9c5e4710f147f
Comments
On Tue, Dec 05, 2023 at 02:28:55AM +0000, SeongJae Park wrote: > DAMON cannot be used from loadable modules since it is not exporting its > symbols. And that is a good thing. We should absolutely not allow random modules probing MM internals. What you posted here is basically just adding hooks without even real in-kernel users.
Hi Christoph, On 2023-12-04T21:12:47-08:00 Christoph Hellwig <hch@infradead.org> wrote: > On Tue, Dec 05, 2023 at 02:28:55AM +0000, SeongJae Park wrote: > > DAMON cannot be used from loadable modules since it is not exporting its > > symbols. > > And that is a good thing. We should absolutely not allow random modules > probing MM internals. I agree. > What you posted here is basically just adding hooks without even real > in-kernel users. I was thinking someone might be able to think even the sample module as real usage since there was actually some questions about it from real users. That said, those were more like questions than strong requests, so I still think this change is somewhat better to be made for at least some folks, but I also agree that this wouldn't be not really essential for everyone, and could be only long term maintenance threat. I personally don't have strong opinion, and thank you for raising your concern. I will hold this patchset unless someone request this change again with good rationale. Btw, I know there were many concerns about unnecessarily exporting symbols, but do we have a formal guideline or documentation about the requirements for exporting symbols in sepcific subsystem? I was hoping to have such one so that I could provide better answer to DAMON's loadable module support questions, but I was unable to find such one with my poor searching skill. This reply could be used for the purpose meanwhile, though, so appreciate again. :) Thanks, SJ