From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 93861485CF9; Tue, 1 Sep 2026 17:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788282636; cv=none; b=UmJMDqHntr34/FZ018ObI/ZOBmS+0wtucN0tjWf2HHOAcqd2wINZHqL76bLE1rqs1fLAhqerKxMfKXk84mvnkUqULY9Lk/2m39QE4N7JH/gRwyjFJPVVtykiW7IfUjWcAPspHjNaXbuBNlLlmr9ikZ6uYdewpiEAnmBs8gklenw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788282636; c=relaxed/simple; bh=e4VrAREP5Sy/PF/J26FL2/2kxqpM8gdomdLbq5y4nbY=; h=Date:To:From:Subject:Message-Id; b=U1LfMP7JACeYfQR2iOhT+HMRsLnFerz8ixAiUgvZhedW5Vesdb0i45xxIgPGJvW67q17xc9tuWXAz/W7n3cITC4n1/JV9p2SYKRzPhwzlXFvMeHS7lj6jtbJOQd/urikQxoP6zM92YG1xkKQorBxdTWCbpVqi++IXkGb/+t3h4w= 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=vliEwh3V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="vliEwh3V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3524C1F00A3E; Tue, 1 Sep 2026 17:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1788282634; bh=w0abYA/bmK0V38SSzNG6SEcg0ldYgeumE42k73Qp3nY=; h=Date:To:From:Subject; b=vliEwh3Vdy2L2JAcLCuMc6mS5k2eLbBtoic+VO34aWgs/dqAXPlH9AFx8Wc5LQnOZ 4mmslW65YQTrR3/rulDvD6AeaWsc197BwfqzyvKCiGVgxrhZbYGLmwTn40JbUC/m/F CP+YK+o5inmUnrVXj0IzTxQtE/T78ZIkR0iHOH78= Date: Tue, 01 Sep 2026 10:10:33 -0700 To: mm-commits@vger.kernel.org,usamaarif642@gmail.com,stable@vger.kernel.org,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-damon-core-skip-applying-scheme-if-region-split-for-quota-fails.patch added to mm-new branch Message-Id: <20260901171034.3524C1F00A3E@smtp.kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/damon/core: skip applying scheme if region split for quota fails has been added to the -mm mm-new branch. Its filename is mm-damon-core-skip-applying-scheme-if-region-split-for-quota-fails.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-core-skip-applying-scheme-if-region-split-for-quota-fails.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: SJ Park Subject: mm/damon/core: skip applying scheme if region split for quota fails Date: Tue, 1 Sep 2026 06:18:42 -0700 Patch series "mm/damon: fix DAMOS bugs in core, paddr and vaddr". Fix misc bugs of DAMOS. Patch 1 makes DAMOS less stress memory allocator under extreme situation. Patches 2 and 3 fix wrong folios walking in DAMON_PADDR. Patches 4 and 5 fix wrong folios walking in DAMON_VADDR. Patches 6-8 handle extreme and unlikely memory situations that can cause divide by zero and underflow. All bugs are discovered by Sashiko. This patch (of 8): damos_apply_scheme() splits a region and apply the action to the subregion if it is needed for not violating the quota. The split operation (damon_split_region_at()) could fail for allocation failure. In the case, the quota could be violated. From the user's perspective, DAMOS becomes more aggressive than expected under the extreme situation. Handle the failure. The user impact is not critical. The failure of damon_split_region_at() is unlikely since it is arguably too small to fail. Also DAMOS being aggressive is limited to the single region. Users can set min_nr_regions to set the maximum size of each region. If it is reasonably set, the transient overhead shouldn't be critical. The issue was discovered [1] by Sashiko. Link: https://lore.kernel.org/20260901131850.98037-1-sj@kernel.org Link: https://lore.kernel.org/20260901131850.98037-2-sj@kernel.org Link: https://lore.kernel.org/20260718171523.87547-1-sj@kernel.org [1] Fixes: 2b8a248d5873 ("mm/damon/schemes: implement size quota for schemes application speed control") Signed-off-by: SJ Park Cc: Usama Arif Cc: # 5.16.x Signed-off-by: Andrew Morton --- mm/damon/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/damon/core.c~mm-damon-core-skip-applying-scheme-if-region-split-for-quota-fails +++ a/mm/damon/core.c @@ -2604,7 +2604,8 @@ static void damos_apply_scheme(struct da c->min_region_sz); if (!sz) goto update_stat; - damon_split_region_at(t, r, sz); + if (damon_split_region_at(t, r, sz)) + goto update_stat; } if (damos_core_filter_out(c, t, r, s)) return; _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-core-skip-applying-scheme-if-region-split-for-quota-fails.patch mm-damon-paddr-respect-folio-end-for-damos_stat.patch mm-damon-paddr-respect-folio-end-for-damos-actions-except-stat.patch mm-damon-vaddr-respect-folio-end-for-damos_stat.patch mm-damon-vaddr-respect-folio-end-for-damos_migrate_hotcold.patch mm-damon-core-handle-extreme-memory-state-in-damon_get_node_mem_bp.patch mm-damon-core-handle-extreme-memory-state-in-get_node_memcg_used_bp.patch mm-damon-core-handle-extreme-memory-state-in-get_in_active_mem_bp.patch