Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01F7523D3E1 for ; Tue, 14 Jan 2025 06:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736837061; cv=none; b=c1tPC6Fcoy0fYU3Dh5/gFWy8Ik2BVjWFme3mklvaJCMwCuWAw3D/FeU4BOrONWA9iHZERtty5/uP9TcnMEZ6PJwHXNrAbluJvNx99+Dp84KsdMj+zQr9PdaWGWbJkNFt7yymYWvKh4Fr8gjqiYMJ7VP3fPm5qON5NYr+yP4Xqbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736837061; c=relaxed/simple; bh=l5WxL4o9CO+TqcXt8NjZUhEZBu9WCjaBEi7ZV2B2+R0=; h=Date:To:From:Subject:Message-Id; b=DzCGLGeubH9HJxSfvqoKHbytCivlWMtUyFK7PddG1IUkckDvh3/iUoZ7j/6mehBteUjboDfkIAei4a3ny4zF3pcejqDbrqFnsedDRKzUviXoIEWA1XDyksULREUvzL8jwpQ7ZromxcfGbSJvuV5LYFoFQdvCCtDCiuxcReZusOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=rz9wdkhx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="rz9wdkhx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9D80C4CEDD; Tue, 14 Jan 2025 06:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1736837060; bh=l5WxL4o9CO+TqcXt8NjZUhEZBu9WCjaBEi7ZV2B2+R0=; h=Date:To:From:Subject:From; b=rz9wdkhx2ven2cWlD06cH5XukuGOQtJeWuoLb0z2FiS/kadLhghdobrrioQqiCeAr zFEa526mW1AxJB6J2DJaZRWJgVp2/Q9xpzIwM/X4wDEmWcK/65e5ld8E2Bd+R/+jV4 16sT0O2ExwN5RTH1VFdVoVF/sUlv8S4Xl3c3mOzs= Date: Mon, 13 Jan 2025 22:44:20 -0800 To: mm-commits@vger.kernel.org,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] samples-damon-wsse-implement-working-set-size-estimation-and-logging.patch removed from -mm tree Message-Id: <20250114064420.C9D80C4CEDD@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: samples/damon/wsse: implement working set size estimation and logging has been removed from the -mm tree. Its filename was samples-damon-wsse-implement-working-set-size-estimation-and-logging.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: SeongJae Park Subject: samples/damon/wsse: implement working set size estimation and logging Date: Tue, 10 Dec 2024 13:50:28 -0800 Implement the DAMON-based working set size estimation logic. The logic iterates memory regions in DAMON-generated access pattern snapshot for every aggregation interval and get the total sum of the size of any region having one or higher 'nr_accesses' count. That is, it assumes any region having one or higher 'nr_accesses' to be a part of the working set. The estimated value is reported to the user by printing it to the kernel log. Link: https://lkml.kernel.org/r/20241210215030.85675-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton --- samples/damon/wsse.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- a/samples/damon/wsse.c~samples-damon-wsse-implement-working-set-size-estimation-and-logging +++ a/samples/damon/wsse.c @@ -30,6 +30,23 @@ MODULE_PARM_DESC(enable, "Enable or disa static struct damon_ctx *ctx; static struct pid *target_pidp; +static int damon_sample_wsse_after_aggregate(struct damon_ctx *c) +{ + struct damon_target *t; + + damon_for_each_target(t, c) { + struct damon_region *r; + unsigned long wss = 0; + + damon_for_each_region(r, t) { + if (r->nr_accesses > 0) + wss += r->ar.end - r->ar.start; + } + pr_info("wss: %lu\n", wss); + } + return 0; +} + static int damon_sample_wsse_start(void) { struct damon_target *target; @@ -57,6 +74,7 @@ static int damon_sample_wsse_start(void) } target->pid = target_pidp; + ctx->callback.after_aggregation = damon_sample_wsse_after_aggregate; return damon_start(&ctx, 1, true); } _ Patches currently in -mm which might be from sj@kernel.org are docs-mm-damon-design-add-monitoring-parameters-tuning-guide.patch docs-mm-damon-add-an-example-monitoring-intervals-tuning.patch docs-admin-guide-mm-damon-usage-fix-and-add-missing-damos-filter-sysfs-files-on-files-hierarchy.patch docs-admin-guide-mm-damon-start-update-snapshot-example.patch mm-damon-explain-effective-quota-on-kernel-doc-comment.patch