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 3B5D043D51E for ; Tue, 28 Apr 2026 14:49:03 +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=1777387743; cv=none; b=In6mAbN0ShGNcEhBf7PQluZTWw/Owd+ya7sBhVnOkjBdlsZILZUjHD34eSoqv+4Npv30pdO9gMohnCeDkF9pi/RU6P7c4xvcR+DEPBw3frNg4A25TVeHeU0tu3S9y62TIHC+eRAe/cWmN6Z3dQnYKCLIeLlDQQrn7hPB9+BSmL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387743; c=relaxed/simple; bh=QlhSwFmVui/cVsx3s2KOVuY3mPAyhfaR2G2pG4XCOzM=; h=Date:To:From:Subject:Message-Id; b=MY5NE1yDAeSTjYOF87Br1y+IyRYgl4acfOdXFUmYnI+S0OJHsYMwD5+oo7myH5qs0IJjWqI1G1+xc/EczQu6O4rxETAWcrx1pldKw/Ndrf7d+Pip5wPDNQnYXftMLYnVn+MMvR3t9NZGoFrgpEcdoV7L84K6afGT3/Uyvuo0YHs= 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=tkYNaVia; 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="tkYNaVia" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF534C2BCAF; Tue, 28 Apr 2026 14:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777387743; bh=QlhSwFmVui/cVsx3s2KOVuY3mPAyhfaR2G2pG4XCOzM=; h=Date:To:From:Subject:From; b=tkYNaViaDCcPjtQtiuCM1rpS3FGUy4M8ETI8qcjR6p6pxsbGzSpdcpxC9ObPXU7Fo S/DDexqfE+R2L0kc1b6H1aUjTnQdASM8z4GBc9h36EtLb/Pz1PJghZnFNtida41nON ZLbJrYMJFpz6YbIzziuNQd7mt4gtJDH2u+qITufA= Date: Tue, 28 Apr 2026 07:49:02 -0700 To: mm-commits@vger.kernel.org,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-damon-sysfs-schemes-implement-fail_charge_numdenom-files.patch added to mm-new branch Message-Id: <20260428144902.EF534C2BCAF@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: implement fail_charge_{num,denom} files has been added to the -mm mm-new branch. Its filename is mm-damon-sysfs-schemes-implement-fail_charge_numdenom-files.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-implement-fail_charge_numdenom-files.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 If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is 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: implement fail_charge_{num,denom} files Date: Mon, 27 Apr 2026 18:33:53 -0700 Implement the user-space ABI for the DAMOS action failed region quota-charge ratio setup. For this, add two new sysfs files under the DAMON sysfs interface for DAMOS quotas. Names of the files are fail_charge_num and fail_charge_denom, and work for reading and setting the numerator and denominator of the failed regions charge ratio. Link: https://lore.kernel.org/20260428013402.115171-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/damon/sysfs-schemes.c | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) --- a/mm/damon/sysfs-schemes.c~mm-damon-sysfs-schemes-implement-fail_charge_numdenom-files +++ a/mm/damon/sysfs-schemes.c @@ -1513,6 +1513,8 @@ struct damon_sysfs_quotas { unsigned long reset_interval_ms; unsigned long effective_sz; /* Effective size quota in bytes */ enum damos_quota_goal_tuner goal_tuner; + unsigned int fail_charge_num; + unsigned int fail_charge_denom; }; static struct damon_sysfs_quotas *damon_sysfs_quotas_alloc(void) @@ -1687,6 +1689,48 @@ static ssize_t goal_tuner_store(struct k return -EINVAL; } +static ssize_t fail_charge_num_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_quotas *quotas = container_of(kobj, + struct damon_sysfs_quotas, kobj); + + return sysfs_emit(buf, "%u\n", quotas->fail_charge_num); +} + +static ssize_t fail_charge_num_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct damon_sysfs_quotas *quotas = container_of(kobj, + struct damon_sysfs_quotas, kobj); + int err = kstrtouint(buf, 0, "as->fail_charge_num); + + if (err) + return -EINVAL; + return count; +} + +static ssize_t fail_charge_denom_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_quotas *quotas = container_of(kobj, + struct damon_sysfs_quotas, kobj); + + return sysfs_emit(buf, "%u\n", quotas->fail_charge_denom); +} + +static ssize_t fail_charge_denom_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct damon_sysfs_quotas *quotas = container_of(kobj, + struct damon_sysfs_quotas, kobj); + int err = kstrtouint(buf, 0, "as->fail_charge_denom); + + if (err) + return -EINVAL; + return count; +} + static void damon_sysfs_quotas_release(struct kobject *kobj) { kfree(container_of(kobj, struct damon_sysfs_quotas, kobj)); @@ -1707,12 +1751,20 @@ static struct kobj_attribute damon_sysfs static struct kobj_attribute damon_sysfs_quotas_goal_tuner_attr = __ATTR_RW_MODE(goal_tuner, 0600); +static struct kobj_attribute damon_sysfs_quotas_fail_charge_num_attr = + __ATTR_RW_MODE(fail_charge_num, 0600); + +static struct kobj_attribute damon_sysfs_quotas_fail_charge_denom_attr = + __ATTR_RW_MODE(fail_charge_denom, 0600); + static struct attribute *damon_sysfs_quotas_attrs[] = { &damon_sysfs_quotas_ms_attr.attr, &damon_sysfs_quotas_sz_attr.attr, &damon_sysfs_quotas_reset_interval_ms_attr.attr, &damon_sysfs_quotas_effective_bytes_attr.attr, &damon_sysfs_quotas_goal_tuner_attr.attr, + &damon_sysfs_quotas_fail_charge_num_attr.attr, + &damon_sysfs_quotas_fail_charge_denom_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_quotas); @@ -2808,6 +2860,8 @@ static struct damos *damon_sysfs_mk_sche .weight_nr_accesses = sysfs_weights->nr_accesses, .weight_age = sysfs_weights->age, .goal_tuner = sysfs_quotas->goal_tuner, + .fail_charge_num = sysfs_quotas->fail_charge_num, + .fail_charge_denom = sysfs_quotas->fail_charge_denom, }; struct damos_watermarks wmarks = { .metric = sysfs_wmarks->metric, _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-sysfs-schemes-call-missing-mem_cgroup_iter_break.patch mm-damon-fix-damos_stat-tracepoint-format-for-sz_applied.patch mm-damon-core-make-charge_addr_from-aware-of-end-address-exclusivity.patch docs-mm-damon-maintainer-profile-add-ai-review-usage-guideline.patch mm-damon-core-introduce-damon_ctx-paused.patch mm-damon-sysfs-add-pause-file-under-context-dir.patch docs-mm-damon-design-update-for-context-pause-resume-feature.patch docs-admin-guide-mm-damon-usage-update-for-pause-file.patch docs-abi-damon-update-for-pause-sysfs-file.patch mm-damon-tests-core-kunit-test-pause-commitment.patch selftests-damon-_damon_sysfs-support-pause-file-staging.patch selftests-damon-drgn_dump_damon_status-dump-pause.patch selftests-damon-sysfspy-check-pause-on-assert_ctx_committed.patch selftests-damon-sysfspy-pause-damon-before-dumping-status.patch mm-damon-core-handle-min_region_sz-remaining-quota-as-empty.patch mm-damon-core-merge-regions-after-applying-damos-schemes.patch mm-damon-core-introduce-failed-region-quota-charge-ratio.patch mm-damon-sysfs-schemes-implement-fail_charge_numdenom-files.patch docs-mm-damon-design-document-fail_charge_numdenom.patch docs-admin-guide-mm-damon-usage-document-fail_charge_numdenom-files.patch docs-abi-damon-document-fail_charge_numdenom.patch mm-damon-tests-core-kunit-test-fail_charge_numdenom-committing.patch selftests-damon-_damon_sysfs-support-failed-region-quota-charge-ratio.patch selftests-damon-drgn_dump_damon_status-support-failed-region-quota-charge-ratio.patch selftests-damon-sysfspy-test-failed-region-quota-charge-ratio.patch