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 50E13213E89 for ; Mon, 27 Apr 2026 15:19:42 +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=1777303182; cv=none; b=Lx0iWtwoGchFUQ7CeT8PdiT27DX0TKP2p7pCjxZJYNBuE0nclNpTbyPAI29BAIlVK8Bylxv2QhbvBfM7LJH9r8vCggFJTC9rwyOEg8R0LcTNLEUTdfjp7PwmtnOlMIHiPIQTHx27rp8mm+Di9kb0D7mPYFTFdlFpAqKX9mCkUoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777303182; c=relaxed/simple; bh=5Q2eg+GxuGv/144GP8cA4lTYhkAUYjTDH8OKPHWNdgM=; h=Date:To:From:Subject:Message-Id; b=kl8fECS5WsF26lrprAfxrWE3E2LfgSwMbtQB/6tFGN+2JFru2Qw7lqVWDOqj2FXWzc48dabZ2W+xNSymZYjiMSXB33MrkSyp4iUNHYS1PifhJK00GvKIatujA7aLvceN7souRQZsLqC2ugyQ0z4088n8lJYZy0wQNpNinMSTXHU= 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=hkodjo9C; 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="hkodjo9C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20CDAC2BCB4; Mon, 27 Apr 2026 15:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777303182; bh=5Q2eg+GxuGv/144GP8cA4lTYhkAUYjTDH8OKPHWNdgM=; h=Date:To:From:Subject:From; b=hkodjo9Cqe2S4C/uv5KY9zC0SCcqNiEM+n44bqMt0XIDPXr0kOs9BRr11uUDf70C7 3OW7hsdgyyhUewLDB7Oo9c0vDtSl7QRjvbfSsP2TEVZV7EKb0T8o0OeynWGqm/s6bc dTVX/LBbHzBEVTS374OTMhW55Rl7fpV0BmGD5jB0= Date: Mon, 27 Apr 2026 08:19:41 -0700 To: mm-commits@vger.kernel.org,vbabka@kernel.org,surenb@google.com,shuah@kernel.org,rppt@kernel.org,mhocko@suse.com,ljs@kernel.org,liam@infradead.org,david@kernel.org,corbet@lwn.net,brendan.higgins@linux.dev,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-damon-sysfs-add-pause-file-under-context-dir.patch added to mm-new branch Message-Id: <20260427151942.20CDAC2BCB4@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: add pause file under context dir has been added to the -mm mm-new branch. Its filename is mm-damon-sysfs-add-pause-file-under-context-dir.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-add-pause-file-under-context-dir.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: add pause file under context dir Date: Mon, 27 Apr 2026 08:12:21 -0700 Add pause DAMON sysfs file under the context directory. It exposes the damon_ctx->pause API parameter to the users so that they can use the pause/resume feature. Link: https://lore.kernel.org/20260427151231.113429-3-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.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) --- a/mm/damon/sysfs.c~mm-damon-sysfs-add-pause-file-under-context-dir +++ a/mm/damon/sysfs.c @@ -866,6 +866,7 @@ struct damon_sysfs_context { struct damon_sysfs_attrs *attrs; struct damon_sysfs_targets *targets; struct damon_sysfs_schemes *schemes; + bool pause; }; static struct damon_sysfs_context *damon_sysfs_context_alloc( @@ -878,6 +879,7 @@ static struct damon_sysfs_context *damon context->kobj = (struct kobject){}; context->ops_id = ops_id; context->addr_unit = 1; + context->pause = false; return context; } @@ -1053,6 +1055,30 @@ static ssize_t addr_unit_store(struct ko return count; } +static ssize_t pause_show(struct kobject *kobj, struct kobj_attribute *attr, + char *buf) +{ + struct damon_sysfs_context *context = container_of(kobj, + struct damon_sysfs_context, kobj); + + return sysfs_emit(buf, "%c\n", context->pause ? 'Y' : 'N'); +} + +static ssize_t pause_store(struct kobject *kobj, struct kobj_attribute *attr, + const char *buf, size_t count) +{ + struct damon_sysfs_context *context = container_of(kobj, + struct damon_sysfs_context, kobj); + bool pause; + int err = kstrtobool(buf, &pause); + + if (err) + return err; + context->pause = pause; + return count; +} + + static void damon_sysfs_context_release(struct kobject *kobj) { kfree(container_of(kobj, struct damon_sysfs_context, kobj)); @@ -1067,10 +1093,14 @@ static struct kobj_attribute damon_sysfs static struct kobj_attribute damon_sysfs_context_addr_unit_attr = __ATTR_RW_MODE(addr_unit, 0600); +static struct kobj_attribute damon_sysfs_context_pause_attr = + __ATTR_RW_MODE(pause, 0600); + static struct attribute *damon_sysfs_context_attrs[] = { &damon_sysfs_context_avail_operations_attr.attr, &damon_sysfs_context_operations_attr.attr, &damon_sysfs_context_addr_unit_attr.attr, + &damon_sysfs_context_pause_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_context); @@ -1470,6 +1500,7 @@ static int damon_sysfs_apply_inputs(stru if (sys_ctx->ops_id == DAMON_OPS_PADDR) ctx->min_region_sz = max( DAMON_MIN_REGION_SZ / sys_ctx->addr_unit, 1); + ctx->pause = sys_ctx->pause; err = damon_sysfs_set_attrs(ctx, sys_ctx->attrs); if (err) return err; _ 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 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