From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796095629; b=1nPEGUnjkz+H0PIic0dMmMKFAA6KR2NCWjZGZXmxV2EkdkjoMgol3+fdeghvR3mwT4sC MzQ9enNDW5PoiNqSQtEZHsPYeRr8qYs5DtHkSWAh7hryEzuJIhyB+gpXJhvjRwHy/tCw1 ZC7NmTgaYVsClR9wWriW+pDbO1loFzCq+Mvi9p3MUJtK+f+6VmQhjIoygWs+cTbo/kuGZ xXO3jmd+DdywFwpVmZ++y4y3b2Sfq3TGlPBdVqCTaV7Y0zP5jsbpcoFFUYiUWylozfZ0G O5b692wjQoP4A3yMr4FKJAldUKRYON6B6jFC/uSVeV2lWq5wHFcaXe7uLCTmsOEtsMA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796095629; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=dFRqe6/y4lKPzzG6uSlMe5hxWYIY9yNbizwWEzHQ9Is=; b=aJbEqU9ovx6b03aSF9Cm802XEiJ6iuNSlyFIsMq81RV0MFxbooyPw+Vddv7u6xUP+CEq Y7Z7ZUUH1++BNVxGNnk69m4/CoF1aMEgAVUU2Af3G/TBcKrQJkegFeACC1jrzxpTlrLcR DJStuzjy6tVcBJItXaQqqHQY4K7b2wBaTJruwlq1UNHE/eofing0AyiBANeVmjmLjXeb3 OQBLyq8wmXRlwOsAGSlfolH3zGGSJG2UUPo/R7Q6QMRRrtJ3vZT21lLCjqsw6RKkck6Ze pWUB+BtJEfPOc7PlMQvsZuidIRaD4dTzZkLi11J9/0hqGMOsq+Bp7XTaCo67ZiwiP5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LNzSNoXU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 326F4606A329 for ; Tue, 1 Dec 2026 03:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LNzSNoXU Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCE9A1F00893; Tue, 1 Dec 2026 03:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796095629; bh=dFRqe6/y4lKPzzG6uSlMe5hxWYIY9yNbizwWEzHQ9Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LNzSNoXUl7qdZ4AXP6GWTLkjiUDO6tAN8yEvM0YRHg8BpnzCYVAHQdhIpfg5Tld1t O5BlQea5BUm/9CfTwvFxtzc7Wq+Xuj02P5dS4JFnmXeXiaekIq8Z1IAdEZX2nMTLSh U3IRgo9j06QC6rRwwxdxN6PCXuPbqjnpFdteAnP6XVI59KSlfrjEB92k+7VGvZP1nG ZuM9eIO7QcU2O2TbTqR5vq+jSdeJWBHp4xw2pcw4pzCooBa1bwEvbyWPLWdy59KrZu ahfr2MLyzCLhJltlA1HLhHrIPNUy6RqHM/51recW0ONpM2YRtSEN08LJprM0AM+uNQ mFrSZ1OX5/nyw== From: SJ Park To: Cc: SJ Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org Subject: [RFC PATCH v2 1/2] mm/damon/core: expose damon_has_probe_weights() Date: Mon, 30 Nov 2026 19:26:52 -0800 Message-ID: <20261201032655.123822-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201032655.123822-1-sj@kernel.org> References: <20261201032655.123822-1-sj@kernel.org> X-Mailing-List: damon@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a DAMON context is configured with data attribute probe weights, it runs in attributes only monitoring mode. In the mode, the traditional page idleness based access monitoring is skipped. Users could manually do effectively the same thing in more flexible ways. They can use a set_pgidle probe prep and a pgidle_unset probe filter, with flexible setup of additional probes. The API callers should use the probe_hits instead of the traditional access frequency counter (nr_acceses), though. Some callers such as DAMOS quota region prioritization score logic would need to be aware of the mode. There is no core API for knowing if it is in the mode, though. Expose damon_has_probe_weights(), which is effectively working for the purpose, to DAMON core API callers. Signed-off-by: SJ Park --- include/linux/damon.h | 1 + mm/damon/core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 45c82f536da5..99f57add0106 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -1195,6 +1195,7 @@ bool damon_initialized(void); int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); void damon_stop(struct damon_ctx **ctxs, int nr_ctxs); bool damon_is_running(struct damon_ctx *ctx); +bool damon_has_probe_weights(struct damon_ctx *ctx); int damon_kdamond_pid(struct damon_ctx *ctx); int damon_call(struct damon_ctx *ctx, struct damon_call_control *control); diff --git a/mm/damon/core.c b/mm/damon/core.c index 2766ebec0150..47295ac44408 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -271,7 +271,7 @@ static struct damon_probe *damon_nth_probe(int n, struct damon_ctx *ctx) return NULL; } -static bool damon_has_probe_weights(struct damon_ctx *c) +bool damon_has_probe_weights(struct damon_ctx *c) { struct damon_probe *p; -- 2.47.3