From mboxrd@z Thu Jan 1 00:00:00 1970 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 6FFE62BFC60 for ; Tue, 16 Dec 2025 18:58:07 +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=1765911488; cv=none; b=GZymFLZQbxCCWqdvlglb5kady903uyOtlwz6vDCyv0MWaR0xHW1nb6WxV2MVmqwqLL/jzsWHnedVjlAgL6VQGKoqVADc3v/Hm4dm7AoZ6K52/ighT6UXgvLdG6FwVIGk2RhWSXOJMR1kpnRlbHrCP9lYpcm75jKCIAQ+NBHfGnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765911488; c=relaxed/simple; bh=MVJP4OdAGbNs2NLH3HA2OVc0wcw70OdBks2R0MeEDxA=; h=Date:To:From:Subject:Message-Id; b=M7Gvu/AHUrOhzgOBUCowXjJmq2wXVlRa1mABF9b/Zk01oss2M/SxlHVrEVedrOY9x8X9VpMhUR4LuXm4fwjzHRK0Wx1ay49YdqrluPNjqOJIccZlrqutyBff9UboaKvQxRisIoER6qzi2mrfZ0Vrzw4kMnFHURVfANBa1IXvWE0= 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=zgigaMXf; 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="zgigaMXf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9827C4CEFB; Tue, 16 Dec 2025 18:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1765911486; bh=MVJP4OdAGbNs2NLH3HA2OVc0wcw70OdBks2R0MeEDxA=; h=Date:To:From:Subject:From; b=zgigaMXfQXioqEIwb6GtEPla6IhorSdAQ3mNrP1o6yWqF6Pd0g/wODe4jkPSk1K5D vHdtik9wCjvlfEmNozh8maJtQozMnLZwKmP231ujbF7Zhn7OoUmNBqM/7Iyv+xuanL YGmcyAxueby10JsihiCEwnZSliEXZwRbxSkFCHRs= Date: Tue, 16 Dec 2025 10:58:06 -0800 To: mm-commits@vger.kernel.org,vbabka@suse.cz,surenb@google.com,rppt@kernel.org,rostedt@goodmis.org,mhocko@suse.com,mhiramat@kernel.org,mathieu.desnoyers@efficios.com,lorenzo.stoakes@oracle.com,liam.howlett@oracle.com,corbet@lwn.net,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-damon-sysfs-schemes-introduce-nr_snapshots-damos-stat-file.patch added to mm-new branch Message-Id: <20251216185806.D9827C4CEFB@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/damon/sysfs-schemes: introduce nr_snapshots damos stat file has been added to the -mm mm-new branch. Its filename is mm-damon-sysfs-schemes-introduce-nr_snapshots-damos-stat-file.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-sysfs-schemes-introduce-nr_snapshots-damos-stat-file.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: SeongJae Park Subject: mm/damon/sysfs-schemes: introduce nr_snapshots damos stat file Date: Tue, 16 Dec 2025 00:01:15 -0800 Introduce a new DAMON sysfs interface file for exposing the newly added DAMOS stat, nr_snapshots. The file has the name same to the stat name (nr_snapshots) and placed under the damos stat sysfs directory. Link: https://lkml.kernel.org/r/20251216080128.42991-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: "Masami Hiramatsu (Google)" Cc: Mathieu Desnoyers Cc: Michal Hocko Cc: Mike Rapoport Cc: Steven Rostedt Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/damon/sysfs-schemes.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- a/mm/damon/sysfs-schemes.c~mm-damon-sysfs-schemes-introduce-nr_snapshots-damos-stat-file +++ a/mm/damon/sysfs-schemes.c @@ -204,6 +204,7 @@ struct damon_sysfs_stats { unsigned long sz_applied; unsigned long sz_ops_filter_passed; unsigned long qt_exceeds; + unsigned long nr_snapshots; }; static struct damon_sysfs_stats *damon_sysfs_stats_alloc(void) @@ -265,6 +266,15 @@ static ssize_t qt_exceeds_show(struct ko return sysfs_emit(buf, "%lu\n", stats->qt_exceeds); } +static ssize_t nr_snapshots_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_stats *stats = container_of(kobj, + struct damon_sysfs_stats, kobj); + + return sysfs_emit(buf, "%lu\n", stats->nr_snapshots); +} + static void damon_sysfs_stats_release(struct kobject *kobj) { kfree(container_of(kobj, struct damon_sysfs_stats, kobj)); @@ -288,6 +298,9 @@ static struct kobj_attribute damon_sysfs static struct kobj_attribute damon_sysfs_stats_qt_exceeds_attr = __ATTR_RO_MODE(qt_exceeds, 0400); +static struct kobj_attribute damon_sysfs_stats_nr_snapshots_attr = + __ATTR_RO_MODE(nr_snapshots, 0400); + static struct attribute *damon_sysfs_stats_attrs[] = { &damon_sysfs_stats_nr_tried_attr.attr, &damon_sysfs_stats_sz_tried_attr.attr, @@ -295,6 +308,7 @@ static struct attribute *damon_sysfs_sta &damon_sysfs_stats_sz_applied_attr.attr, &damon_sysfs_stats_sz_ops_filter_passed_attr.attr, &damon_sysfs_stats_qt_exceeds_attr.attr, + &damon_sysfs_stats_nr_snapshots_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_stats); @@ -2760,6 +2774,7 @@ void damon_sysfs_schemes_update_stats( sysfs_stats->sz_ops_filter_passed = scheme->stat.sz_ops_filter_passed; sysfs_stats->qt_exceeds = scheme->stat.qt_exceeds; + sysfs_stats->nr_snapshots = scheme->stat.nr_snapshots; } } _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-core-introduce-nr_snapshots-damos-stat.patch mm-damon-sysfs-schemes-introduce-nr_snapshots-damos-stat-file.patch docs-mm-damon-design-update-for-nr_snapshots-damos-stat.patch docs-admin-guide-mm-damon-usage-update-for-nr_snapshots-damos-stat.patch docs-abi-damon-update-for-nr_snapshots-damos-stat.patch mm-damon-update-damos-kerneldoc-for-stat-field.patch mm-damon-core-implement-max_nr_snapshots.patch mm-damon-sysfs-schemes-implement-max_nr_snapshots-file.patch docs-mm-damon-design-update-for-max_nr_snapshots.patch docs-admin-guide-mm-damon-usage-update-for-max_nr_snapshots.patch docs-abi-damon-update-for-max_nr_snapshots.patch mm-damon-core-add-trace-point-for-damos-stat-per-apply-interval.patch