From patchwork Sun Dec 22 23:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13918316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 269C4E77188 for ; Sun, 22 Dec 2024 23:12:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 865116B0083; Sun, 22 Dec 2024 18:12:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 815586B0089; Sun, 22 Dec 2024 18:12:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6412C6B008A; Sun, 22 Dec 2024 18:12:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 37B036B0083 for ; Sun, 22 Dec 2024 18:12:30 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DFCFE4555C for ; Sun, 22 Dec 2024 23:12:29 +0000 (UTC) X-FDA: 82924145304.04.BA4FBC7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 6C84316000F for ; Sun, 22 Dec 2024 23:12:03 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Jt08AH6I; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734909130; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zZI+3qzmAg8PjFHyEqye3qcFFrlxX0NFSTrhNMvNmeI=; b=zjp8PgC+7I4gAT+DhMEXghPYSAX4C98KLiSrSSeOyet0FQ4aVwUpq0xDMCkOHsbMLYQLVI /72WuuyZ+QT1M2B0DFRvp2NnVC7CjumtH9BDD4SgqXoYON6P7KSXoVag9ycGXSZhuCB/+r BynF8611uqWzEz2fcRZ70uHK6zRPheo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734909130; a=rsa-sha256; cv=none; b=BmTEtNj+JkpJEbE/duIjMUxnl8mPOQiZ6w9/I0r+ySDi0EN37i4H9LfzpMb/oL6pbmU5uW N+i3o8b3He0t+SmBhi6guiZe4UpccZkTwohgMEEFq55CF0cu+rnkTcd6gAoNz//jY3Vu7l 5lRjHF2H65Jit4BHuHJG7RP7lx8xWCc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Jt08AH6I; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 786975C54FE; Sun, 22 Dec 2024 23:11:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD54AC4CEDE; Sun, 22 Dec 2024 23:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734909147; bh=VnA1Kpl6cnNCncV299IxvKMXy0LENGhUCK7E8iW560U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jt08AH6I6TbqJCHXd/acPRzbZyWx52z2MmhPoaQ2cyp9RK1qweXBp0RrtA4MOMIBf 07kwOrXbJ9793M3E5h78GCOPP0O+dDF4m3oX0+rmbRpoRZv6PblExjqSOxhtjkhEtG HtPhow9N6iHFBadT8FT42tARcpFEL+zyCJtQi/6RslUp2TDnTx/c7N+LSbxrnYeiKw HqMtwjSUIY7TCZmIDYPGiDDaniR5sBgT3AyBNUkrh4m25SObQZEFuJngEE/DN3eyXy eROFrH+b04IqphTPehy3CDM3Pj7l8t6LQLvPHFQ11Gnv9BkZ2xIUh2Gqv/l75QtwCO +R4AOfkouo0CA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 2/2] mm/damon/core: fix ignored quota goals and filters of newly committed schemes Date: Sun, 22 Dec 2024 15:12:22 -0800 Message-Id: <20241222231222.85060-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241222231222.85060-1-sj@kernel.org> References: <20241222231222.85060-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6C84316000F X-Stat-Signature: fz7sq1fb58g9s8co1jmmd3anbpypq1hb X-Rspam-User: X-HE-Tag: 1734909123-17897 X-HE-Meta: U2FsdGVkX1/swIxcRZq7CNGCPyf0Z1gvJgXeDb8LZu2bU3XZEUpNXBcTi694OacUJq3Qjg4wtnbpN6NcVxgtkykNSAAjmhVlO2yyvrSkYrzXKzpfoh1L0hE6I2ktDnFeTrMV6WTAybNBRAFjMs7UktBKBpfYYQ245S6Vfh+PW34FSvfHEtodSpsw1wjDSjS4XcOfQrraE4Yz9sYVcG9hljd8rW1e2B7gahRUstCToZESxPsOwOqxH7dE4AQZ2ZSNWpdbv/F/g0CABYplCG7dYksIXZkUhygPpxpx3ZH17FepIS/AnwQFGKZVTqnbLuzPeVg4tutWuDDQOWq48yWs4AIxAOlbiBKxaNDTtu0qL+VhPYlkL8oC6ixQlogqOXgXwEd5c3AbF0LDjyn8i5PMwYVrZbhGbFcZ5Jc1EjmTQ6cOd5ig0555gOfTucvcCsdvveE4R+8qrjJmuF052CBB82/mgBKz2+WGM0OYfGQOQBcD/YyUbz7gPkqcJWRyM5CQVzQE7LFboJXUl9AWRfv9/isokOBx/benkwyuWLUkD8K5J2tFmbVgoBddvsPXhrvaVYfbU/ZJVB9EHAObWdQ/Bp/TWQtyXonl41t2DU25lQNCuV99hfdJvQoxX2+1QDGCx2hAkyloKudZDSlz15R0v+v9klmY2kZbteybRGSTHrr7G2P4jC++FKnCBjTQyjs0OvJBEQbqJPQ1UKW1bmxmJpi29nxV99iBb1pwrlQupEnkAmJVyQpGPARmFmliATGvQP7cbge6eUDTYdQ0Pa9X+EltfqoK2Yf173MfWAiF6M29b7gOcxz7OYRP/iAYRpGnALr6v3EFduB+bibKov5hyI+4EdZXjD9gXFPYdPX+FkLViFsRNKxzMagcmdRAZsuJw1a2mccZG338moSN5kU/ef3HGrhir77NXJBQ3LNSeYl0o7xdIeskkFmhjTKlAMihtR8XfyJ+dKjeBIvYi5x AwYVQAe9 Wfwo2Fhq23zfi9lALoRdndfNudZVy18CyzY0g1/zsbFzm+ZF98nsPRll5pVo0dS+iFHZN5cKadJhWWEj2XiaXqSNUmxL6cUWcrkD8VLeEM97oDyJa5KXi6eBKxFnfgRnWEwDAmBsyQ2GHCX407pibqNoaoW968lVZQkRmqnj2KdTh5dACrXPOU0yPjBD2i6MU5+yOen960icb9ADdbjeYaaDYQv6qJUhI3iU3PHmZQB+FZuk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: damon_commit_schemes() ignores quota goals and filters of the newly committed schemes. This makes users confused about the behaviors. Correctly handle those inputs. Fixes: 9cb3d0b9dfce ("mm/damon/core: implement DAMON context commit function") Cc: Signed-off-by: SeongJae Park --- mm/damon/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 931e8e4b1333..5192ee29f6cf 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -868,6 +868,11 @@ static int damon_commit_schemes(struct damon_ctx *dst, struct damon_ctx *src) NUMA_NO_NODE); if (!new_scheme) return -ENOMEM; + err = damos_commit(new_scheme, src_scheme); + if (err) { + damon_destroy_scheme(new_scheme); + return err; + } damon_add_scheme(dst, new_scheme); } return 0;