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=1795997739; b=eWXb9VHN+itaLLFw7qRbU1AW2FkfLInfTfWpiVoc1Gh7Po0iUFm/fs+oNakiToxmRnVQ eaiF90xhWCA/NsKSDz8ob1dzCXvwmPkogrAL2BU9VGtn1xQij9PgM4fH+7cp34qA5FlU1 Qyl7lVH5y+mxBFCOAXr1aiQIH+Hi+sgYD9fZg3I2i8kyZgSJULYcuRbiugS5g7pY3l5LD xIcIXTqIqf5MlKgMaCTFRttj2DjsKH8SOZpx3wNoqy8hfuispZVIbQ8hPUPd9GB4xYUTv JYn2/pDQXUfGUWd5X7M9xmM7yeNjOWppialhS0SAVrEKo+84ZTnH0uuImSi3t250MuA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795997739; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=rwcmFTJIsFsNcc14xjyx5xWoF+UDgJFol4tuhMzfeXo=; b=IrU3JupsLBfg/n8dgz79zG1PTus9iDylFanbT+QUyHvUzS9edmkeyoOc3RYtQAOXZp1M 3ge981AIWhELz0osaRX8wXfY1qovhPx4o4LDE4rw7i08ZHXNpHfviwcpOWyVs9V8eU8pS u6ZYKOPp3s99LkQTasL7knkPjaZRprgTfva/t0bjRq0aM3eEgUf9wB6Fj0+WAvk+PYBt3 EvnxarFzbSPWEiaXEdRfQpBAIfqk++HcpceIRjnkMmH2IA3btvT+30Kz5sfQdLtY8QqPD 28n83L6JU9Ly2CsmOPcteH+5a6a6M3MqwCPo/xDTwxtFyaHc4Ua5Idjqc3M/EqdXAUw== 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=Ga4WQJKB; 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 83DB0606A31C for ; Mon, 30 Nov 2026 00:15:39 +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=Ga4WQJKB Received: by smtp.kernel.org (Postfix) with ESMTPSA id E89701F00896; Mon, 30 Nov 2026 00:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795997739; bh=rwcmFTJIsFsNcc14xjyx5xWoF+UDgJFol4tuhMzfeXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ga4WQJKBfXx7VZDfck5lgym72qzvpeOrKVq7fSFmcW1xeYWbHvCASHn34sbF0LTkM K9xek3Dw5UDR3kv7Zm9gdwDSGUBPztidP23kpgAJsuybQJyc+kuFw4jTyi/Clk0kuz F6NEIYoHURuBfyxESjekFe2XRLWAdi4IlncAAFI/73xyM6RdUeDAl/hUiwhHsX9l3J KsB3wvPE79ItL0dp7VZA8c/aw8rK3PphLP9l9hGloLGm5bwhNFHI3bjx1j1nbyBwX4 VgYZAXIGjTUKLyo+l1hiQvh6q6a//dFppGidwt4ITxKvEo8cut1SntPUGU4kuBMcT9 Xd7ZbMDlgTkeA== From: SJ Park To: Cc: SJ Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org Subject: [RFC PATCH 1/2] mm/damon/core: expose damon_has_probe_weights() Date: Sun, 29 Nov 2026 16:15:28 -0800 Message-ID: <20261130001530.173703-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130001530.173703-1-sj@kernel.org> References: <20261130001530.173703-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 5eac19ed99b1..96a95f06eb73 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