From nobody Wed Dec 17 19:01:01 2025 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 1BE99158219; Fri, 3 May 2024 18:03:22 +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=1714759403; cv=none; b=eRN6GhBoE+vSo7MCSghJPaVW9ptfGq6gb4jwpNpO5yVu2COzSr47Vey1yudZPM5peQEf0OyUZSOZlPg8MxNnjDvwxBLNBPlFj7ug2OO3sW0KCF1lRZaAfoOKX3qraF3OAypD02Cpz3ac2hGgGlZZXeT/VzoDvcW65zFQ7O3grCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759403; c=relaxed/simple; bh=zSTAIYDsysAOFhSKZc274DZ8idV6c4WJQL8j1/BLSlE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T9Y3YRLUMezD2UsEppCCij/G8QmI12ZNxXctzEQ7Eqn9xoQInXWVNUzdGuNTM7gA1YL/YnhgJN8t74/cTsZbv01f8OnmiygZSfK0NSP3rfFSXOb1W8s0PpcpC7njXop1BozqVkN+J9I0z2ethFdt63sZWZxIXwwgZZ3GUHvsQh0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c71lokwp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c71lokwp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52DEFC4AF1A; Fri, 3 May 2024 18:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759402; bh=zSTAIYDsysAOFhSKZc274DZ8idV6c4WJQL8j1/BLSlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c71lokwplM4u6LWwWT9mEgvfvFZezL/myTEwABYNAPeXhXSK7pe5V2OOUbsCJblvJ mWEN3cCe5wg4UwB5LxnXWWrbiSkv7fFox/yfAUF3vp3J9oeSTb+oQmGRMzXdPyKX/e MlbYAfhdOK5DClrKc6TbgdoJMmn+08aYUS5exWq/5uWmcOD3aYGDPKjmZN/RQcgmJd Pcp/I3auQn0krCRzZ16b4PZMgXMARPIuN7gk1scj5aF1f47SteyRr5MMRRRItlQ8/I QHo7GGPcAMTWkReXmaBfoSobz12v5bsgxsDS3/Y+dxrR/MeGunw01ia48IkfLV/Vvr ec8AGXSHMGx/A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/10] mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() Date: Fri, 3 May 2024 11:03:09 -0700 Message-Id: <20240503180318.72798-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damos_quota_init_priv() function should initialize all private fields of struct damos_quota. However, it is not initializing ->esz_bp field. This could result in use of uninitialized variable from damon_feed_loop_next_input() function. There is no such issue at the moment because every caller of the function is passing damos_quota object that already having the field zero value. But we cannot guarantee the future, and the function is not doing what it is promising. A bug is a bug. This fix is for preventing possible future issues. Fixes: 9294a037c015 ("mm/damon/core: implement goal-oriented feedback-drive= n quota auto-tuning") Signed-off-by: SeongJae Park --- mm/damon/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 172095e68c5d..6392f1cc97a3 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -346,6 +346,7 @@ static struct damos_quota *damos_quota_init(struct damo= s_quota *quota) quota->charged_from =3D 0; quota->charge_target_from =3D NULL; quota->charge_addr_from =3D 0; + quota->esz_bp =3D 0; return quota; } =20 --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 AB092158844; Fri, 3 May 2024 18:03:23 +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=1714759404; cv=none; b=YTwwksw5Svbdx8exFcHytXV7GAVFP2SAOKJ5mpONFR1oVWg6ANpurOBk2QYk7DlKqZE4/c97RzeE4VteJlNSsa0ficx2XZEyNGWbsUq9l5fgFL6skOc2jy6aHXqRHXLv+5LRWX1vUtnQxxFRyjHwEcYEwQy4nrUuV5sMQ3Xj/u0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; c=relaxed/simple; bh=BxWQ3nfJ8G0tvTTltgrGE2Vi8fVZjZKQ8RTpaGZaaWo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tXu4t4ddHO/v1zGTnBY3yrkE+DtWAlNzQRLPjSackYKpO+NfNP75LAN4DmlRaoUI3hI7krBaSj7MgTdI0l0UaFM3MYoSO3xnBl7PsL64pIV5PgO7zKugsJQ9WUZNV2+MYuxpWpcb2bTjG6jKezBq19ekxrAe6+ob3fxVYgCspiU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ozf53p/Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ozf53p/Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E110DC4AF1C; Fri, 3 May 2024 18:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759403; bh=BxWQ3nfJ8G0tvTTltgrGE2Vi8fVZjZKQ8RTpaGZaaWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozf53p/YJ8O1q9ETgyXzeTGjW/yQlxn6NO1VcwwlyB5fhh79Z/RU1DvDX94tKHXJu NsxMbG/hnGuFZpLqegru2su4C38GCd4GeW5Quns/i/+qP9o6be8FGs4t0BGVZB55Mn 9trnxuoEJq8oeqtK7BMePrWszC+NOztLCzuHG46t7ldbbHESDRT9Dwmltq/TaZ3Y/M BE5CX1uGYcY9suy8F8PdvDWsy+Fw6WJNRGelV/7dsjeVyxYEannjrjzGitWrtL5jjT CRis0hFCHlOrM/BpzLuYChhdkNGITy96Kn3Z0ap8peht+EgMJDHn63ctEz1Q+oWGKr U+M1NpLfXp42A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/10] selftests/damon/_damon_sysfs: check errors from nr_schemes file reads Date: Fri, 3 May 2024 11:03:10 -0700 Message-Id: <20240503180318.72798-3-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON context staging method in _damon_sysfs.py is not checking the returned error from nr_schemes file read. Check it. Fixes: f5f0e5a2bef9 ("selftests/damon/_damon_sysfs: implement kdamonds star= t function") Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/= selftests/damon/_damon_sysfs.py index f80fdcef507c..fffa74a78bd7 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -341,6 +341,8 @@ class DamonCtx: nr_schemes_file =3D os.path.join( self.sysfs_dir(), 'schemes', 'nr_schemes') content, err =3D read_file(nr_schemes_file) + if err is not None: + return err if int(content) !=3D len(self.schemes): err =3D write_file(nr_schemes_file, '%d' % len(self.schemes)) if err !=3D None: --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 AB0D2158845; Fri, 3 May 2024 18:03:24 +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=1714759404; cv=none; b=nVnOOiJNq2rjwd8c04nmUSjN7EgHhlHKYzDfxUbL8qt1V+pz/EqR2u1HdNM+YuPlkw2sbwxwiSOsW0KbKSPkFE/UpG9wxZrR+LVxGPedllJm9VTeu+yEyvRtGpI73GrPu5MbYcIklWr33lkVlvKt6UcLx/sY9vricjNVi0+kh4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; c=relaxed/simple; bh=3OCJo+mdOOU+eYdVwx29gwu7K+0FClrtGDmTiLBUZvo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ciuoz4YUwhiyZoNh+i8Fv1hJT1QsZFKDf+GNK1/JzG7ELLcMVUjJW16lJOKYs4Lmn38CAI+TtRpZBuKKBfCRRt0/akXP+a6F4vVOsT81J9K3IcLC56tyvjIeMQxWvvSzetdSXM8DfoOt4CB+4mW8vco/B1d9XhqWKPc8UHtJ6ys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mNN27e7D; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mNN27e7D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC55C4AF48; Fri, 3 May 2024 18:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759404; bh=3OCJo+mdOOU+eYdVwx29gwu7K+0FClrtGDmTiLBUZvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mNN27e7D0zmbKWvmat7LzEJ39cI0NXToH46je6GTKxDPulfpOt3Z+Hq0yQfmDRFCG YzLjFaAxqfcNfFodwdGgqkgdn7gM23A0H3HOgN6wPDz6/JDzbYbwOwPvO8jLQ44148 NJRIPYUQcnKfnmYFVTsRN7zt2P/QM0wO6rnqCyceKpojejtqUUslxMcrkltmbeEP01 FNbdumleZNUFrX8fq9RtfVWcxYWrayO6CV/yLnhKeF8BpqGsvUywy5IqnIWqcouWzm IbdAeCODmvwrjnL4E5ZgHWDSl6aVG3/lDSrMYXIrKTnZmHP5lBUzfEDWcRm6YWo35Q kZG9dG+PQvCYA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/10] selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts Date: Fri, 3 May 2024 11:03:11 -0700 Message-Id: <20240503180318.72798-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" _damon_sysfs.py assumes sysfs is mounted at /sys. In some systems, that might not be true. Find the mount point from /proc/mounts file content. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/= selftests/damon/_damon_sysfs.py index fffa74a78bd7..5367e98817a9 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -2,7 +2,18 @@ =20 import os =20 -sysfs_root =3D '/sys/kernel/mm/damon/admin' +ksft_skip=3D4 + +sysfs_root =3D None +with open('/proc/mounts', 'r') as f: + for line in f: + dev_name, mount_point, dev_fs =3D line.split()[:3] + if dev_fs =3D=3D 'sysfs': + sysfs_root =3D '%s/kernel/mm/damon/admin' % mount_point + break +if sysfs_root is None: + print('Seems sysfs not mounted?') + exit(ksft_skip) =20 def write_file(path, string): "Returns error string if failed, or None otherwise" --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 50DC215886D; Fri, 3 May 2024 18:03:25 +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=1714759405; cv=none; b=iG5buyECkrIPCsEQNYD1tN7ZQAl25fx/mTiarsHLP+E1SBG0ZRMi1T96wgceHp4P+Rs0OzydhghBrMdKJxAKQstUM8tGRzVH9xzoB16ESIBTy5ZPgnwwVVu/C+jgOZy58DCd8qW7KqpO+wZ+6yJKCprd7p2WOWWVqVkEdnwxI5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759405; c=relaxed/simple; bh=O896s/BxYxzWe3ajbJ4BImY+pg58FthjeGXrHo/B0j4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cDIv9AoC1YlLz0W0p/Bag9AfA4L30vnJhewDWoY1r0r7hZQaTsUVQthP1Av4efoTiDVykSSGhQ7fFkKte9pi2HfcUu0giYnj8qHZz5ChrtKNzwvEsggpNMmAY7Mq7IH6UV10P/MtYbxOC+x4zigSjIGTsyMB2pUcOuVOUjw8FtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZA9XkNE+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZA9XkNE+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 574DBC4AF19; Fri, 3 May 2024 18:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759404; bh=O896s/BxYxzWe3ajbJ4BImY+pg58FthjeGXrHo/B0j4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZA9XkNE+qEOq2aveG/dzoklGtVvPqKqMVRlrhy5FdFGRb1twcaqBmFuykp3wJR9Fz V1gFei8V8hmOgx0Om3/MYS0lSOy1AmFTu18wzIOd+LjyNSmfNDrPVLX2kNVSBy91yc OJXEjSWp0OSOWag8SUTM2g4O3TPJdk4QbqC302K/rzrAFORsQ/DHAGbR/5AM4D07/j wsXXEp1fS6dT/bFqk4Cb6AD+nxljDwPENxHadwdLiXv6mOhzyASMhGYVtAMdAqKGbT VkA8ok60PcpOl5uaeqqAJxKuTnP70hou30XOt2n1FQAuAmYZWLrLr7/dI3BlDVcrWy cFi3wMLJSxP+A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/10] selftests/damon/_damon_sysfs: use 'is' instead of '==' for 'None' Date: Fri, 3 May 2024 11:03:12 -0700 Message-Id: <20240503180318.72798-5-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" _damon_sysfs.py is using '=3D=3D' or '!=3D' for 'None'. Since 'None' is a singleton, using 'is' or 'is not' is more efficient. Use the more efficient one. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/= selftests/damon/_damon_sysfs.py index 5367e98817a9..01d4b8022d50 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -45,11 +45,11 @@ class DamosAccessPattern: self.nr_accesses =3D nr_accesses self.age =3D age =20 - if self.size =3D=3D None: + if self.size is None: self.size =3D [0, 2**64 - 1] - if self.nr_accesses =3D=3D None: + if self.nr_accesses is None: self.nr_accesses =3D [0, 2**64 - 1] - if self.age =3D=3D None: + if self.age is None: self.age =3D [0, 2**64 - 1] =20 def sysfs_dir(self): @@ -58,27 +58,27 @@ class DamosAccessPattern: def stage(self): err =3D write_file( os.path.join(self.sysfs_dir(), 'sz', 'min'), self.size[0]) - if err !=3D None: + if err is not None: return err err =3D write_file( os.path.join(self.sysfs_dir(), 'sz', 'max'), self.size[1]) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'nr_accesses', '= min'), self.nr_accesses[0]) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'nr_accesses', '= max'), self.nr_accesses[1]) - if err !=3D None: + if err is not None: return err err =3D write_file( os.path.join(self.sysfs_dir(), 'age', 'min'), self.age[0]) - if err !=3D None: + if err is not None: return err err =3D write_file( os.path.join(self.sysfs_dir(), 'age', 'max'), self.age[1]) - if err !=3D None: + if err is not None: return err =20 qgoal_metric_user_input =3D 'user_input' @@ -137,14 +137,14 @@ class DamosQuota: =20 def stage(self): err =3D write_file(os.path.join(self.sysfs_dir(), 'bytes'), self.s= z) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'ms'), self.ms) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'reset_interval_= ms'), self.reset_interval_ms) - if err !=3D None: + if err is not None: return err =20 nr_goals_file =3D os.path.join(self.sysfs_dir(), 'goals', 'nr_goal= s') @@ -201,30 +201,30 @@ class Damos: =20 def stage(self): err =3D write_file(os.path.join(self.sysfs_dir(), 'action'), self.= action) - if err !=3D None: + if err is not None: return err err =3D self.access_pattern.stage() - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'apply_interval_= us'), '%d' % self.apply_interval_us) - if err !=3D None: + if err is not None: return err =20 err =3D self.quota.stage() - if err !=3D None: + if err is not None: return err =20 # disable watermarks err =3D write_file( os.path.join(self.sysfs_dir(), 'watermarks', 'metric'), 'n= one') - if err !=3D None: + if err is not None: return err =20 # disable filters err =3D write_file( os.path.join(self.sysfs_dir(), 'filters', 'nr_filters'), '= 0') - if err !=3D None: + if err is not None: return err =20 class DamonTarget: @@ -243,7 +243,7 @@ class DamonTarget: def stage(self): err =3D write_file( os.path.join(self.sysfs_dir(), 'regions', 'nr_regions'), '= 0') - if err !=3D None: + if err is not None: return err return write_file( os.path.join(self.sysfs_dir(), 'pid_target'), self.pid) @@ -275,27 +275,27 @@ class DamonAttrs: def stage(self): err =3D write_file(os.path.join(self.interval_sysfs_dir(), 'sample= _us'), self.sample_us) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.interval_sysfs_dir(), 'aggr_u= s'), self.aggr_us) - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.interval_sysfs_dir(), 'update= _us'), self.update_us) - if err !=3D None: + if err is not None: return err =20 err =3D write_file( os.path.join(self.nr_regions_range_sysfs_dir(), 'min'), self.min_nr_regions) - if err !=3D None: + if err is not None: return err =20 err =3D write_file( os.path.join(self.nr_regions_range_sysfs_dir(), 'max'), self.max_nr_regions) - if err !=3D None: + if err is not None: return err =20 class DamonCtx: @@ -329,24 +329,24 @@ class DamonCtx: def stage(self): err =3D write_file( os.path.join(self.sysfs_dir(), 'operations'), self.ops) - if err !=3D None: + if err is not None: return err err =3D self.monitoring_attrs.stage() - if err !=3D None: + if err is not None: return err =20 nr_targets_file =3D os.path.join( self.sysfs_dir(), 'targets', 'nr_targets') content, err =3D read_file(nr_targets_file) - if err !=3D None: + if err is not None: return err if int(content) !=3D len(self.targets): err =3D write_file(nr_targets_file, '%d' % len(self.targets)) - if err !=3D None: + if err is not None: return err for target in self.targets: err =3D target.stage() - if err !=3D None: + if err is not None: return err =20 nr_schemes_file =3D os.path.join( @@ -356,11 +356,11 @@ class DamonCtx: return err if int(content) !=3D len(self.schemes): err =3D write_file(nr_schemes_file, '%d' % len(self.schemes)) - if err !=3D None: + if err is not None: return err for scheme in self.schemes: err =3D scheme.stage() - if err !=3D None: + if err is not None: return err return None =20 @@ -384,16 +384,16 @@ class Kdamond: nr_contexts_file =3D os.path.join(self.sysfs_dir(), 'contexts', 'nr_contexts') content, err =3D read_file(nr_contexts_file) - if err !=3D None: + if err is not None: return err if int(content) !=3D len(self.contexts): err =3D write_file(nr_contexts_file, '%d' % len(self.contexts)) - if err !=3D None: + if err is not None: return err =20 for context in self.contexts: err =3D context.stage() - if err !=3D None: + if err is not None: return err err =3D write_file(os.path.join(self.sysfs_dir(), 'state'), 'on') return err @@ -401,20 +401,20 @@ class Kdamond: def update_schemes_tried_bytes(self): err =3D write_file(os.path.join(self.sysfs_dir(), 'state'), 'update_schemes_tried_bytes') - if err !=3D None: + if err is not None: return err for context in self.contexts: for scheme in context.schemes: content, err =3D read_file(os.path.join(scheme.sysfs_dir(), 'tried_regions', 'total_bytes')) - if err !=3D None: + if err is not None: return err scheme.tried_bytes =3D int(content) =20 def update_schemes_stats(self): err =3D write_file(os.path.join(self.sysfs_dir(), 'state'), 'update_schemes_stats') - if err !=3D None: + if err is not None: return err for context in self.contexts: for scheme in context.schemes: @@ -423,7 +423,7 @@ class Kdamond: 'sz_applied', 'qt_exceeds']: content, err =3D read_file( os.path.join(scheme.sysfs_dir(), 'stats', stat= )) - if err !=3D None: + if err is not None: return err stat_values.append(int(content)) scheme.stats =3D DamosStats(*stat_values) @@ -471,10 +471,10 @@ class Kdamonds: def start(self): err =3D write_file(os.path.join(self.sysfs_dir(), 'nr_kdamonds'), '%s' % len(self.kdamonds)) - if err !=3D None: + if err is not None: return err for kdamond in self.kdamonds: err =3D kdamond.start() - if err !=3D None: + if err is not None: return err return None --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 C03FE158A04; Fri, 3 May 2024 18:03:25 +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=1714759405; cv=none; b=ghO0c5FIdcxNoJcPtAC1EBm+3vq/qc4jJa/qy68u8l/YMUYICRY0/AkmXOoHQW69C8RSjp4K1UVtCelhQy+hvgk0BpjfWGs7+1COOYUz0geukz+LJ7psEWq+byPInYn7UDlyhfoK11RvoNKN+So4cSEKLa25JPyFV9ujorNFzi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759405; c=relaxed/simple; bh=wl4KaQNGGSUoln/HN59nrI9DZXm2wms4eum28pA9dLo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cYHOpsSyaWVNLYzTZvEv8FPymtNMJ5VBHk9Oaq2ac0fngv74K5bp4dTciA2ZKngdeT2aDFq/l48ZLGPpCr3T0/WkuoJ1ybmOKeLsZgfGA5i1ymzkZm/nuHTxBNXZWGI6IXrbZQ2U8tgWBArQ82qmdSHpEemqhqEihpQpBTHjm+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GcMdqlu0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GcMdqlu0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2465BC116B1; Fri, 3 May 2024 18:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759405; bh=wl4KaQNGGSUoln/HN59nrI9DZXm2wms4eum28pA9dLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GcMdqlu028SzxGvUHkmkFsYzLK9DLlJ0smYEoaFbRsz6nd0eJHiWiTS3Ba1ejCjpw CoAJow0Rt1FgNM4tEdiLD6cQLwt8572cvjve44lT7OPGhFGsWFVAB7XqESNvHuT1LP VkqwJ0uEVSMlW/MsUzOQ4kEg9GJ4Gx96jyQXgPACJyMvdU1WnWWk7Q6v7RoCmlzCd4 UICxzjc+YRXF4qhGiU56z1PQL+iXRxM+cdpqMTXGlPNFqI7yF7kA5s3yamKARLqDPl +kVh3zZZUEy0UmxksbLdRSmD2MZLM8dXFRGY2EYvlxwlyDKlh52qs9Lv5odKsIFyxf bQDzBQivuom/w== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/10] selftests/damon: classify tests for functionalities and regressions Date: Fri, 3 May 2024 11:03:13 -0700 Message-Id: <20240503180318.72798-6-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON selftests can be classified into two categories: functionalities and regressions. Functionality tests are for checking if the function is working as specified, while the regression tests are basically reproducers of previously reported and fixed bugs. The tests of the categories are mixed in the selftests Makefile. Separate those for easier understanding of the types of tests. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftes= ts/damon/Makefile index 06c248880172..29a22f50e762 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -7,16 +7,21 @@ TEST_GEN_FILES +=3D debugfs_target_ids_pid_leak TEST_GEN_FILES +=3D access_memory =20 TEST_FILES =3D _chk_dependency.sh _debugfs_common.sh + +# functionality tests TEST_PROGS =3D debugfs_attrs.sh debugfs_schemes.sh debugfs_target_ids.sh +TEST_PROGS +=3D sysfs.sh +TEST_PROGS +=3D sysfs_update_schemes_tried_regions_wss_estimation.py +TEST_PROGS +=3D damos_quota.py damos_quota_goal.py damos_apply_interval.py +TEST_PROGS +=3D reclaim.sh lru_sort.sh + +# regression tests (reproducers of previously found bugs) TEST_PROGS +=3D debugfs_empty_targets.sh debugfs_huge_count_read_write.sh TEST_PROGS +=3D debugfs_duplicate_context_creation.sh TEST_PROGS +=3D debugfs_rm_non_contexts.sh TEST_PROGS +=3D debugfs_target_ids_read_before_terminate_race.sh TEST_PROGS +=3D debugfs_target_ids_pid_leak.sh -TEST_PROGS +=3D sysfs.sh sysfs_update_removed_scheme_dir.sh +TEST_PROGS +=3D sysfs_update_removed_scheme_dir.sh TEST_PROGS +=3D sysfs_update_schemes_tried_regions_hang.py -TEST_PROGS +=3D sysfs_update_schemes_tried_regions_wss_estimation.py -TEST_PROGS +=3D damos_quota.py damos_quota_goal.py damos_apply_interval.py -TEST_PROGS +=3D reclaim.sh lru_sort.sh =20 include ../lib.mk --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 E08D7158A32; Fri, 3 May 2024 18:03:26 +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=1714759407; cv=none; b=MP6xo9o086fXmVYRc2itgdA0tU5c35QCE2pnzlv3o5tHd8/XQ+mijXWr13JnYDEv1f6bZZlb24NSmoG+aaasj2wkyADdTxObW5YIwGLtGpTA0IJ95SpCynApeqZpgwzbn+hgko+xhUTgNGHRkVjNKfJiAXj+xd+qwQplWqM2Lm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759407; c=relaxed/simple; bh=AS2JS3BGQVHo5RzbTVMIa5UQeXJ+fVLWbjaYsPF6V/A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FnLjw99rjEA2ypAu/zm7ceVbElSYdzupBi2LpV510QoxbJlnaSI+lSuO+H9vyr3zMuONLLwFp/gehZADv6YiYzwDfIGmn/pm8Xb5aGusZGYvV4lYeajDwIevzXtAno2Vc4QM9Jy5sWVst4+RCHJnvvpAJ0e6r0co9AyLapARYws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ueOhhzQV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ueOhhzQV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D49F2C4AF49; Fri, 3 May 2024 18:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759406; bh=AS2JS3BGQVHo5RzbTVMIa5UQeXJ+fVLWbjaYsPF6V/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ueOhhzQVHOqQWS9hYd7/BOnLu3AxufgKPocOXtiZLC21qJmV/tqXZ61UompLt/MJd +WVAZWgVSP9eVni1vx7w7nHUO/+7h6JQlu391AY1frY6stamIP3CGGUutmqakezWye s/dYRTuD9XCUL49qOm8PjT5kc3Z7DWRP4jDyjRpZsrl8J5sRKJpdMTjfA86XtGDudR QOevYHYzah/lMOmxfaYzul8yQPsENcjYKTXqc69dZfwQQRLegrgx3Af9MdlHGWpmab SWfahDGBBQdx6ypo2/1tIBOCEnouQr1GEQiSV0YRQvAW9xuSeVTo8bXLtQViTC4sYJ x0l/C9XFWnn2g== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 06/10] Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file Date: Fri, 3 May 2024 11:03:14 -0700 Message-Id: <20240503180318.72798-7-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The example usage of DAMOS filter sysfs files, specifically the part of 'matching' file writing for memcg type filter, is wrong. The intention is to exclude pages of a memcg that already getting enough care from a given scheme, but the example is setting the filter to apply the scheme to only the pages of the memcg. Fix it. Fixes: 9b7f9322a530 ("Docs/admin-guide/mm/damon/usage: document DAMOS filte= rs of sysfs") Closes: https://lore.kernel.org/r/20240317191358.97578-1-sj@kernel.org Cc: # 6.3.x Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 69bc8fabf378..3ce3f0aaa1d5 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -434,7 +434,7 @@ pages of all memory cgroups except ``/having_care_alrea= dy``.:: # # further filter out all cgroups except one at '/having_care_already' echo memcg > 1/type echo /having_care_already > 1/memcg_path - echo N > 1/matching + echo Y > 1/matching =20 Note that ``anon`` and ``memcg`` filters are currently supported only when ``paddr`` :ref:`implementation ` is being used. --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 97F07158D7B; Fri, 3 May 2024 18:03:27 +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=1714759407; cv=none; b=W5AOToa9PYu/SoXz2csa2EsJzvRjRokvaJqv30naTXS5yGWhNHSX77m3eSDC640XI4Ax2PA6ASAWo1XDXGN7qvIvRf3K4UMagL8/fUtfRJ+Z6TBMPGh7Wb2iXKT+WPU3qWdbEZzGQEJplwu2iViclbTZ2fi8mjaY07AkuZkuOIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759407; c=relaxed/simple; bh=KPWNhDHoK1WCiSSpG+hqPSsIhkDFJ5Gj7faBmjSb9kA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hOzSEVzkDcYiT1nb6Ew0MrQf5hC1ju1lc+UHyoodixdBmpcd+sbjyhadfj20ewiOFIRYYJxBukhBqCMbYb9r6bMJfwsx0dekJwX/zNw24ty9ecaOYjG7phbbFJvkB1Ps1EDjBsMxhb8/sPXZ4nA3omq2XGIE1NdSLdYwwQL4Lag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RNaMciG4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RNaMciG4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A14E9C4AF18; Fri, 3 May 2024 18:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759407; bh=KPWNhDHoK1WCiSSpG+hqPSsIhkDFJ5Gj7faBmjSb9kA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RNaMciG4+Dgw2+9RRQO/lsyLSTD1cz1ayVlCpEn3dwnyprRbglpLy1lfTg7rGhZ4j bSM9JZFtnPhK9QxYb3PnrI0Ry8Tq6wJyWtpu+oLasQN27ysClArNLObWsQVzWWSidn Lp5HshD0xLuIeOqjMDAkwyoiCc1WOm2bRIekRbJN8awSmkciQlznyYd0PHIGV6Ud4z LwWIFN2MQq4Ff2wfvdUT3xD/J5oBoP7ffRBCV/EApv/tW9s2Wd1jmp8m4nSkSI61Fm RW5ugV8nhg5yAGArxE5dolr6yhf3PI12Mu5zxXfU2NMW4moeZPisjWtm2X1J7nfIEo M5vX5WxitzZSg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 07/10] Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command Date: Fri, 3 May 2024 11:03:15 -0700 Message-Id: <20240503180318.72798-8-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To update effective size quota of DAMOS schemes on DAMON sysfs file interface, user should write 'update_schemes_effective_quotas' to the kdamond 'state' file. But the document is mistakenly saying the input string as 'update_schemes_effective_bytes'. Fix it (s/bytes/quotas/). Fixes: a6068d6dfa2f ("Docs/admin-guide/mm/damon/usage: document effective_b= ytes file") Cc: # 6.9.x Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 3ce3f0aaa1d5..e58ceb89ea2a 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -153,7 +153,7 @@ Users can write below commands for the kdamond to the `= `state`` file. - ``clear_schemes_tried_regions``: Clear the DAMON-based operating scheme action tried regions directory for each DAMON-based operation scheme of = the kdamond. -- ``update_schemes_effective_bytes``: Update the contents of +- ``update_schemes_effective_quotas``: Update the contents of ``effective_bytes`` files for each DAMON-based operation scheme of the kdamond. For more details, refer to :ref:`quotas directory `. =20 @@ -342,7 +342,7 @@ Based on the user-specified :ref:`goal `, the effective size quota is further adjusted. Reading ``effective_bytes`` ret= urns the current effective size quota. The file is not updated in real time, so users should ask DAMON sysfs interface to update the content of the file f= or -the stats by writing a special keyword, ``update_schemes_effective_bytes``= to +the stats by writing a special keyword, ``update_schemes_effective_quotas`= ` to the relevant ``kdamonds//state`` file. =20 Under ``weights`` directory, three files (``sz_permil``, --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 4C48A158DA3; Fri, 3 May 2024 18:03:28 +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=1714759408; cv=none; b=a5pjIjFEwWsbsWmnCTraDGXnH74oW0u1Dh4678G+OC62rM+R23wAQUS7voU/aEwz4ih5FKSYZUko/ePt2/18OlfJYsjl0+vXcpCCro4QPwedZYMp9karWdQN0vux7EJHLnktChPOZNuXcdaKCWJRx9aS4XQ0IWyWRG3XpLnkkxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759408; c=relaxed/simple; bh=Kr16aWsUWHmzs0T3rMgu4QN0Xzu0Ms/e3QljzklXCpY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BdNY3KGDm+qn3e0Oc5ejDQBdTIly0CW61MsN2SLhleRZOYenopmGLKNhXZkQFyn4IVrIBUIoaAxQHN9fNbM8cv9hGDvLaLgDzB4hLaZZkxZ7LY6u9asKObTnOSSY0PR4zlnSFTdg6Z0xYeA5aFTetbrflfWZfe+n+oGcGVzPHEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J7w9nGDb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J7w9nGDb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D0AAC4AF19; Fri, 3 May 2024 18:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759407; bh=Kr16aWsUWHmzs0T3rMgu4QN0Xzu0Ms/e3QljzklXCpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J7w9nGDbaTbVNvv//EAR/1njh5p6lE60qGH7jBDMIDT21if4xM2hV4mOvqwVQspqI WsDHWJ4RMZ8lILUhRxAXa6KZBwXZB1jht2lDxwbn4FJ5Kgif8TlZfFBnJmtpVVXSL+ JL6RPq9/hqZHjGgDIoPUxqiB9JvYWxwqA90sLjcXJi/KZwvqOB58k9SKgWIX1hHMg9 5SgjtB0adzb/2Ubt6JS3QO2DkwLz2HxGJSUmuV8u/JnZM9WSZTGOqmAxl241tHBo7G q8VfeLPNsrd76mwdWktnd/q1Dv9RiaQPQJpZxMaaWkEo45v3Y3l3BUClaqInZxJaif 70PRjztQYcfxA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/10] Docs/mm/damon/design: use a list for supported filters Date: Fri, 3 May 2024 11:03:16 -0700 Message-Id: <20240503180318.72798-9-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Filters section is listing currently supported filter types in a normal paragraph. Since the number of types are higher than four, it is not easy to read for only specific types. Use a list for easier finding of specific types. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 46 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index f2baf617184d..1873755358af 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -461,26 +461,32 @@ number of filters for each scheme. Each filter speci= fies the type of target memory, and whether it should exclude the memory of the type (filter-out),= or all except the memory of the type (filter-in). =20 -Currently, anonymous page, memory cgroup, young page, address range, and D= AMON -monitoring target type filters are supported by the feature. Some filter -target types require additional arguments. The memory cgroup filter type = asks -users to specify the file path of the memory cgroup for the filter. The -address range type asks the start and end addresses of the range. The DAM= ON -monitoring target type asks the index of the target from the context's -monitoring targets list. Hence, users can apply specific schemes to only -anonymous pages, non-anonymous pages, pages of specific cgroups, all pages -excluding those of specific cgroups, pages that not accessed after the last -access check from the scheme, pages that accessed after the last access ch= eck -from the scheme, pages in specific address range, pages in specific DAMON -monitoring targets, and any combination of those. - -To handle filters efficiently, the address range and DAMON monitoring targ= et -type filters are handled by the core layer, while others are handled by -operations set. If a memory region is filtered by a core layer-handled fi= lter, -it is not counted as the scheme has tried to the region. In contrast, if a -memory regions is filtered by an operations set layer-handled filter, it is -counted as the scheme has tried. The difference in accounting leads to ch= anges -in the statistics. +For efficient handling of filters, some types of filters are handled by the +core layer, while others are handled by operations set. In the latter cas= e, +hence, support of the filter types depends on the DAMON operations set. In +case of the core layer-handled filters, the memory regions that excluded b= y the +filter are not counted as the scheme has tried to the region. In contrast= , if +a memory regions is filtered by an operations set layer-handled filter, it= is +counted as the scheme has tried. This difference affects the statistics. + +Below types of filters are currently supported. + +- anonymous page + - Applied to pages that containing data that not stored in files. + - Handled by operations set layer. Supported by only ``paddr`` set. +- memory cgroup + - Applied to pages that belonging to a given cgroup. + - Handled by operations set layer. Supported by only ``paddr`` set. +- young page + - Applied to pages that are accessed after the last access check from the + scheme. + - Handled by operations set layer. Supported by only ``paddr`` set. +- address range + - Applied to pages that belonging to a given address range. + - Handled by the core logic. +- DAMON monitoring target + - Applied to pages that belonging to a given DAMON monitoring target. + - Handled by the core logic. =20 =20 Application Programming Interface --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 19ACE158DCB; Fri, 3 May 2024 18:03:28 +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=1714759409; cv=none; b=Lg7wtvYMr0pUV/08uM9yBzU3sgWKYsjCtOltmFPxiKljSAqj+ZKuPrFvXaRlrmqXp0XVXrlp5IFesjCkykyZufqaJR9k3TffBBQNsVBW3SL81T0RC/CcUgBdRlIcDiWyQoAqxC2+Gk6PQMFkfLc4HZVOqXuXQnYZBbh4jUByAhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759409; c=relaxed/simple; bh=vvc+A8ByGJ8xt/IgKthXz7OStObcnnunoP3kVT7p2/c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XxT7XVkU5E3eLnciYZW6b7021xnWHdJvTtx02e8MwePW8pyePwaVD9xaoIb6IC1WAzWAxBTGgc5MmtvJlmak4/QSxGsMIBfm+LSRlDShn9kTNukF7yXTcALSCmujyVPTKD6+0mMa76kgmgr/9I0Y7vn2yfeHbh06uTSZ2enTplo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gzzkfqr+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gzzkfqr+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28E1BC4AF48; Fri, 3 May 2024 18:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759408; bh=vvc+A8ByGJ8xt/IgKthXz7OStObcnnunoP3kVT7p2/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gzzkfqr+kVCfXlIKoHA2gbCdNyEFbHbZh2BRCGxe0x3lv8EucgG8XZp6zvKD1iThb aOAvuMnXwXzfbJgJfGR63SjlpMHoSStan0RleGxeDpgHzHrulAsTdSc2BlsL2gYdlD d2GE25HvkZ+/cgX9u2WAmhfaTfMOHutdtvuiyCjLETlL9Yovp0As3Rdu0o1zmVp6ex S8ns2yGBVmfzM2ARcz3sXb6R/zMXo5YF6VXSb+bdslYyozEIK6ll+zCnVMgMss3wZe vz1aFxisyDfxSMLDc1FWiorLrPkx/fUvUGK7BUg8pF1E5bBh2YTjzsCJ1NRvCVnoOX ZqTqBDoSXDTdA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/10] Docs/mm/damon/maintainer-profile: change the maintainer's timezone from PST to PT Date: Fri, 3 May 2024 11:03:17 -0700 Message-Id: <20240503180318.72798-10-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The document says the maintainer is working on only PST. The maintainer respects daylight saving system, though. Update the time zone to PT. Signed-off-by: SeongJae Park --- Documentation/mm/damon/maintainer-profile.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/mm/damon/maintainer-profile.rst b/Documentation/= mm/damon/maintainer-profile.rst index 5a306e4de22e..ea42f57cf9dc 100644 --- a/Documentation/mm/damon/maintainer-profile.rst +++ b/Documentation/mm/damon/maintainer-profile.rst @@ -48,9 +48,9 @@ Review cadence -------------- =20 The DAMON maintainer does the work on the usual work hour (09:00 to 17:00, -Mon-Fri) in PST. The response to patches will occasionally be slow. Do n= ot -hesitate to send a ping if you have not heard back within a week of sendin= g a -patch. +Mon-Fri) in PT (Pacific Time). The response to patches will occasionally = be +slow. Do not hesitate to send a ping if you have not heard back within a = week +of sending a patch. =20 =20 .. [1] https://git.kernel.org/akpm/mm/h/mm-unstable --=20 2.39.2 From nobody Wed Dec 17 19:01:01 2025 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 CA9E41591ED; Fri, 3 May 2024 18:03:29 +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=1714759409; cv=none; b=UeUEzfaCihg0KkujZtn3NI4XEjYueWlKpr1E0bXpx3PVe35aBNVufMm+TWSBL7cMAp91YHNPulwZJjpjf6g/+Zb9MyvYnzgiGRwHYwZPSI+pheXHAH2Ebb0JGIQ5Gkjlvg+FCplOUQan9jd2YFZgbz57uFAnaovy9fXaUs4gpcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759409; c=relaxed/simple; bh=a02Zh+VsvTrK6WKXPgaeuspiXlSro+oRgLJGLtu2svs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AXbD8W5l2Aga47ow1plg5V0kijHX6KuTj1/WfYWx9EpPyZPBEcdvqmC36C3keyahWLSgZlqkJuGdPnIXW8CpxswO8lx8V6H+kV+4NO0bDVgFCF+2Jf8/Ye6+RWFbFD6xG10zDJnCvQXvl3m19YYqkuYVbdx9/XSaU5eXjhYPZTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MpCAjq/P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MpCAjq/P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D96B5C4AF50; Fri, 3 May 2024 18:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759409; bh=a02Zh+VsvTrK6WKXPgaeuspiXlSro+oRgLJGLtu2svs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpCAjq/PwjGAnPgFL65cPmH9OKC2XvO5cfrU8CelwHa2IjOGwUR0spNoneoQ+JHve ZgAe/EcGmV3QJyTq7sRJvcm8P2lyZIS8GBZmaKK3gefvVc8Isf5nGB7VqWBWT5rQcm qMgn/KlZTV8pXq45eCEn1+waj4K/7iJwm7zKZ9Ap36o/OUKs0+rnoBrw10EFWI6kRO 4RwdQluz00sczmBT4/baD9TMPZvHAm786k1iPaJSNeYuiMTTGeFCn+nYOaWhQKV+SG H8ijK9qv6VG1m2OaOebzIHIAH93JhcP6CiPt2596d0bRT6b8/msyRk7yaZ43MSEOLz NYCe7Utr+bpzA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/10] Docs/mm/damon/maintainer-profile: allow posting patches based on damon/next tree Date: Fri, 3 May 2024 11:03:18 -0700 Message-Id: <20240503180318.72798-11-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The document mentions any patches for review should based on mm-unstable instead of damon/next. It should be the recommended process, but sometimes patches based on damon/next could be posted for some reasons. Actually, the DAMON-based tiered memory management patchset[1] was written on top of 'young page' DAMOS filter patchset, which was in damon/next tree as of the writing. Allow such case and just ask such things to be clearly specified. [1] https://lore.kernel.org/20240405060858.2818-1-honggyu.kim@sk.com Signed-off-by: SeongJae Park --- Documentation/mm/damon/maintainer-profile.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/mm/damon/maintainer-profile.rst b/Documentation/= mm/damon/maintainer-profile.rst index ea42f57cf9dc..8213cf61d38a 100644 --- a/Documentation/mm/damon/maintainer-profile.rst +++ b/Documentation/mm/damon/maintainer-profile.rst @@ -20,9 +20,10 @@ management subsystem maintainer. After more sufficient = tests, the patches will be queued in mm-stable [3]_ , and finally pull-requested to the mainline b= y the memory management subsystem maintainer. =20 -Note again the patches for review should be made against the mm-unstable -tree [1]_ whenever possible. damon/next is only for preview of others' wo= rks -in progress. +Note again the patches for mm-unstable tree [1]_ are queued by the memory +management subsystem maintainer. If the patches requires some patches in +damon/next tree [2]_ which not yet merged in mm-unstable, please make sure= the +requirement is clearly specified. =20 Submit checklist addendum ------------------------- --=20 2.39.2