From patchwork Thu Dec 19 04:03:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914442 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 16A28E7718B for ; Thu, 19 Dec 2024 04:03:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FD236B0083; Wed, 18 Dec 2024 23:03:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1ACD76B0085; Wed, 18 Dec 2024 23:03:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09C506B0088; Wed, 18 Dec 2024 23:03:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E32916B0083 for ; Wed, 18 Dec 2024 23:03:42 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9C407A13FC for ; Thu, 19 Dec 2024 04:03:42 +0000 (UTC) X-FDA: 82910363634.21.7069974 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf01.hostedemail.com (Postfix) with ESMTP id 4D6AD40018 for ; Thu, 19 Dec 2024 04:03:16 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Z2Zz6jKF; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581005; a=rsa-sha256; cv=none; b=ReOzVSiLICLulE6fpGzvABv5l8r0m4xyznVIiBDRPVyDpFIWIRBqfKyEzhRq5n7Ke3f+VV B6hZYFvIfQ16fQ9LdvoR/nrl1eWYhEdyzSJbTZjCjyOdng8qDpjIFYKUfOOX0Wj7M5tK1a Ov594A3/FxaYzshaGJFgazfTLMt50Iw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Z2Zz6jKF; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581005; 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=vHqq0KQ88qLGkj5flYZZPVUQ5e2k1rMAbyL/Eq2pKs0=; b=XV9r6SjZJW0l5IhkTBQHk5wkRcohalWI2wNrwUY7qNKy1lHwEJqq6RDqSRH1r0h6sgy6k1 rJlm08PK8IWu/ovKZ1mWfmCyuhNEImlALBpicHtt2+Woh4sqfxCi7I171HUCejtW3+LwGq bLyLGbx2OuhUeijRwPmgP6e9w32ODXY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id EFDE8A41BED; Thu, 19 Dec 2024 04:01:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B80FC4CED4; Thu, 19 Dec 2024 04:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581020; bh=6yAcbnM6J2idHIjWcNsWaXW+gfpMIfb6CiDEsPN4WLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z2Zz6jKFVEPW7u1pYxFRdlJrY348lqcmWUcfha2+coLLc1HpWoHnTIEUfYg2ziXlC 51ibgYnkuv8dFEKmc1FBcw14hA74jR5dTKVqsb9V8e5E51G4T2ZylTxk9znabTMit9 ohbI4MhC0Re8TXQRCyrAYXo89HrLTs88AjPe31a7yabDNYi/A29oO995ydVGxEvyFR 6A7mzFy59DR/oDcHw19Bc6MRFkMZiE7h5d/MMwZ9PZ1vJmPuDLtvTjdaNcArav1vWf 749M3/3bFJ+mh+1kpk9B/5HUGfV1HxjH6bXsEqPiAQ6M36FDqcrzKHQJUiQ7wMKdHZ P2VR8NWEGYptg== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 01/18] mm/damon: clarify trying vs applying on damos_stat kernel-doc comment Date: Wed, 18 Dec 2024 20:03:10 -0800 Message-Id: <20241219040327.61902-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4D6AD40018 X-Stat-Signature: uzhafs71aidag4t7sjrgrfe8f6w8e59m X-HE-Tag: 1734580996-898274 X-HE-Meta: U2FsdGVkX1/VBh4ijoVGZCFMboDtqBkouDfHE8+AgyzLdBGuOomjwee9kQHQScmZehx+02x3i7JhfjkqJVHXqDXZYrD9kqYl7FNAMRWv9mlfWpS7NuJckYmZDSrXCuAJIs9HYIxDyhubrsDpichFF5Mpf7/k8m2yOhjfUlUVPk5FLo7Px8kqvG+3jKx24S5foAXhVw44iIkWX4ahWW/sxWpfjT2shI9SSBJElaFeYh5ETdV6BeBNksUXICu7HyiFI/Vu9lDfjEYl1q2zpY6kYXxJLv92D4Hoc40fP5wwaCW330cQMWpoalhZUoHLY7o2XQIvedeBA5nk0hCRlfPgM+atl0lBbUSkbE/G5fbBSD8pPPP9ylNLk4sxF1GEaFfOSV7F4gn7JJSNGplYvA1rw94AR+850lHIuXwsLauXrJgyNL1AR5jOfjCQWUbFDXcPtUn7JZVsC+hjm0byCCiRUuNgBKxMKtkaMsUhoKSIqreRyb20iU5NwRlqfXOB3xv9av1BgglgQ8n+pn9Mn7UhWuuaa4umHGQvj6kCEKkUFnRE4hJJNmiYTFq4wb1ooXvdJvuwpN0TYmgLBBsceDSZ/TUexnosvMR1EYxnFyFV/0vSRGaweyYCcd7rX393j36GThkMEZRNVDHmh8ErIESRwqsdx+Gdz2idSfTUGJmw6ETjEvTjQSrLwrvps1NsbvQphrWJmIlI7ZkpoPxrMJOFdzvinYBBTERKZ2rryURpoLMn4HeKQWUx43+xuc1rtV7z3sXabGIB9dWVOfzZ9UCff+L6v6MkTo37DVw9tSturwd+l+YXeEKBIot+QLCY0Q6fZ+AgLcp+HBd2rHKSvDpV14NHT3THGK7hAiBM17Eo2JltkqpVbd2SjorC6FzYsYez5aQkx8GQnJFuvek2/GWCl18Nos7FrXF5cgXhmVzLDTmN32VNpAueR0bRhzIHNp56gWxFyeGbiYR9bR+qJYf rWd/a9yb AwYTgYgnj+6Sp+ahNWIc7sA7USBokqaheW8IqiG5N/vikEhyMqgykvXQadmQlGOb6psdDnOYyT2/NCYTUsphQ0X1hvgPeAz2F45FnIfvBShu1UkUEXU88c86iPSQTx8cRRxEtT9Rqk7MgHux61rPCh/3XA9e/yRjUcyNg9CIEPuCgY7PSihW3NT7ODTbZp1iXmBGlsrTDTWf34F2POucjnkmASROrZPbkS/vzwunJJ//oUj+f9/IjIMuiD4jTcttTsdwSKdVUBTO4QYIhdRLAhy1FIw== 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: DAMOS stat kernel-doc documentation is using somewhat implicit terms. Without reading the code, understanding it correctly is not that easy. Add the clarification on the kernel-doc comment. Signed-off-by: SeongJae Park --- include/linux/damon.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index b4165cc41d99..f66fa0ab9350 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -292,6 +292,23 @@ struct damos_watermarks { * @nr_applied: Total number of regions that the scheme is applied. * @sz_applied: Total size of regions that the scheme is applied. * @qt_exceeds: Total number of times the quota of the scheme has exceeded. + * + * "Tried an action to a region" in this context means the DAMOS core logic + * determined the region as eligible to apply the action. The access pattern + * (&struct damos_access_pattern), quotas (&struct damos_quota), watermarks + * (&struct damos_watermarks) and filters (&struct damos_filter) that handled + * on core logic can affect this. The core logic asks the operation set + * (&struct damon_operations) to apply the action to the region. + * + * "Applied an action to a region" in this context means the operation set + * (&struct damon_operations) successfully applied the action to the region, at + * least to a part of the region. The filters (&struct damos_filter) that + * handled on operation set layer and type of the action and pages of the + * region can affect this. For example, if a filter is set to exclude + * anonymous pages and the region has only anonymous pages, the region will be + * failed at applying the action. If the action is &DAMOS_PAGEOUT and all + * pages of the region are already paged out, the region will be failed at + * applying the action. */ struct damos_stat { unsigned long nr_tried; From patchwork Thu Dec 19 04:03:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914443 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 3F708E77184 for ; Thu, 19 Dec 2024 04:03:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C01D6B0085; Wed, 18 Dec 2024 23:03:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2494A6B0088; Wed, 18 Dec 2024 23:03:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E9DF6B0089; Wed, 18 Dec 2024 23:03:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E65346B0085 for ; Wed, 18 Dec 2024 23:03:43 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 97DCB813F1 for ; Thu, 19 Dec 2024 04:03:43 +0000 (UTC) X-FDA: 82910363172.01.6219B13 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf15.hostedemail.com (Postfix) with ESMTP id 8E85EA0006 for ; Thu, 19 Dec 2024 04:02:53 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JDkuN2WL; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1734580985; 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=LU1x9f+mZtZt952K2y1urNO86Cad/ypJ6b98gBIzy+8=; b=dZOH8pFlwJT3En5LDVzMoQJGY9v9QNZZNSezkfWh3c+uo9DK/Hx7CjxsMacKdNfJ9ba/Fh 990+nXSetKr0ihpHaAVCOg5nH0wTjkAb1u5evvRqpy9FMIsB7ePb0igofDKXQmVrkDLCw/ istG8hjqjQSim/PVYs2WUyjschREAgw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734580985; a=rsa-sha256; cv=none; b=qriYdUjuD3l4Vb5CknuM25G9yfKEjd1Grs47Err7Xn2W23E/faIwm0qL4qsHn4GJx8OMpw HSir3OdUQOoAwtBeRMiJiuuQ9ajL46iTxk9DP6QuwxFIne8Nkhd3HEGlAOYH1fGmJ8B2f1 cuUo1uRw/k2OUUdG+nFRb1ipDEOql44= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JDkuN2WL; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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 nyc.source.kernel.org (Postfix) with ESMTP id 0607FA41BEE; Thu, 19 Dec 2024 04:01:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D141C4CED6; Thu, 19 Dec 2024 04:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581021; bh=jJiLMSjkfkiYNfqxKD0GDVmVQI/aoRtBVTgnj8eD1Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JDkuN2WLlnPgAv//q0xBglbG9EYR/cthGZiW6EjWvwpjvDkvLFZ7FOr/ikOteFVGQ XDOOUzXbBvMQ7dShJAEdkCj7SAKSC+36QxfDZcPkvWQWvhFkvxJupX4yrgRw0r6GQj T73a31iyJ7UEjMOJOECkvHN6rqie35KwSCybo2DW0J7JnS/NzGdl/mHl9DlMLz5vFw C0a7AuuiR0DHE9LaykwVt/MDuB+V4KJ86y8lKd1uYjkvbTBoHF1GnnTfRaYC5B2rAW 53TuNslNJMDEBd7yFyOnzx6isEwGekyXbfiw1eFd3Qzw1RdHUhOqWAdkBc3ex3sJrK 72M4g0EN5xjeA== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 02/18] Docs/mm/damon/design: document DAMOS regions walking Date: Wed, 18 Dec 2024 20:03:11 -0800 Message-Id: <20241219040327.61902-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8E85EA0006 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: jgt1oytwp8rfey3x3gf8x8fxf5q6oyxs X-HE-Tag: 1734580973-349282 X-HE-Meta: U2FsdGVkX1/MdheswjOmJSDSa3FpEx0LOUEvA0cZl19htuYGImn7AWIznZFIn+ruFQYEGn7OeJTX61zrTn8nG241/nsJUangPju4ly3Zkoen57gHao3IMKU2aOht6yf9QBjt8CJuBaZZ/nzGHIfFLdsDcxIKTkQuG96GsAbJ9efbam1sLR8EEf96CoYfyvfGb97HseTHx7vnmSrbPM8zZGRdniOw9vEXTnen70AHi5oG7Bi33iCyB8DqkMAymzBlA774wNtIfb83ZDAaxcEK2aIbKTCiPGvNBiJTK4sl7dEu7WhXG1jIgTZ34a8AGsIxdfZyr7hy6wlCa+ktqADFv7iSnBxQ8gNKnNdlIDd/4Fir1zb/fV6sc6xiVU/mDd0SBOAjJ9sYmTxGl+wzH+KvVwiGYs3DkSE+SoRbnNzzEMzvLOReTkC4vMcwbIsdcskc+PPLDa5+He66eSikehbxi/SZX4n+R/bLmaVx9sFvtISCF1N3TZE/fOe3jRPOY/6J0gCK4Ty57SiaMo7kq3hb01cAc3SWigt1O2F+5smEEmCgqkkyNZZ8mfNzIgdqGo/5xuNKW5j9qZeoYgLTRqcC1xM6Met6JBRL+6ghHiA1ZY2ktop4dwy8xjLzcadVcOYMDnQ5jA4QGKBHPpk41GkyFbWRFhpCDm895v4XqefDH6+x9nMJi3UqBRTiZkHSNO/n2Cm8BeERGHWemlSHQI/Z2EvJrQ5gNC4J+pbL8xPsMrmWyFW6seCE7w1OefNiPta2FqsbeDonugtr4v4Z4GNynKaemv8/tAYL/kDiYnV9HOj0rfdLPO+srXPmxl7lXp6jm9FiTIGQ+dT0+VwyDfujKuaIdNOxUb+DE5Bu36x1DgNi5JabZhqW33ZqlNHQXu4xGZ2eL6JG5XtiqZXtwaTsI3xRxMlrRwPNY82nqt17GEji/HcYY2AAlYYUXTTT3lPaA/cyW8IVWpetxHX3LlR TjGryOfl 4ay1gd6zdRyt6OEvFLE84/PkYjj1S/wakQF1ZWGNYeIaLooqAVmrAaPQ8xeZv5G2rNDLGDKfUT9gsm+fOvx2dSyYbdoGkVQF5Cel+wPpUfJj71CflZuoO1ZZqvb1BKE5D9rLaPqUKIRuf56txuHZ6tFU314Kqw/fs0cUfEBKwoMCeV5V3VoPy8o5DHJ7Bm04lnh6IDSAu/EBOfwcQ0EXW+xEQuGLyeS6/DNxcbkcf7fP2pXHqNYXvAFHdKxnRUVdskHz+aNEfkvvD+T8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.124426, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMOS' regions walking feature is an important feature for efficiently retrieving monitoring results or DAMOS-internal behavior. Document it on the design document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index f9c50525bdbf..a577ae40e71c 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -540,6 +540,17 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface documentation. +Regions Walking +~~~~~~~~~~~~~~~ + +DAMOS feature allowing users access each region that a DAMOS action has just +applied. Using this feature, DAMON :ref:`API ` allows users +access full properties of the regions including the access monitoring results. +:ref:`DAMON sysfs interface ` also allows users read the data +via special :ref:`files `. + +.. _damon_design_api: + Application Programming Interface --------------------------------- From patchwork Thu Dec 19 04:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914444 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 BD815E77184 for ; Thu, 19 Dec 2024 04:03:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D95416B0089; Wed, 18 Dec 2024 23:03:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D50F36B008A; Wed, 18 Dec 2024 23:03:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B99906B008C; Wed, 18 Dec 2024 23:03:45 -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 99ACE6B0089 for ; Wed, 18 Dec 2024 23:03:45 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 592D6121335 for ; Thu, 19 Dec 2024 04:03:45 +0000 (UTC) X-FDA: 82910362500.17.E014DC7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 8E3A91A0003 for ; Thu, 19 Dec 2024 04:03:09 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U2tTbxmm; spf=pass (imf19.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=1734581001; 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=FvOuyD+dzUT6bkYzQVW2IutYs0g51GNldT62UK1XMwY=; b=iO48URQFEigOVbC4qGk8M3H33NdbtzUbPNr2LDJMEO2GGg2mtRYDBf04xIYOi8vlV9oomJ ZK35upvSNEmN+Yud/YDnqw0xSSQNqbXrBgJ9e1odVp8M8+KB88BG/HQawMxiH5VmfODpcJ lbJIRfZCzMyFeW9z8EWGw1v8Yh9tdaU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U2tTbxmm; spf=pass (imf19.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581001; a=rsa-sha256; cv=none; b=IEeqircGd5vv5QTt8N+tGo+HodFx4SZ8kN1GPTJS6doZcGw0GiKyOyEN2DpYPxte0rtLcX zToWsD5RuKDRoMzzWKC2njiSVVRrDNOKutbtZ+AtHP8eNagKpKTiZsnZA+HJT2LiQJrIo8 sv6GF5Eg9uQk68V1sIrdhO6V9nxFql8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9E6F55C65F4; Thu, 19 Dec 2024 04:03:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A633C4CED4; Thu, 19 Dec 2024 04:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581022; bh=Aw/qCp2OKsDn0Vp0elm6T6OQsuDbvPiF9mR4j+5HNd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U2tTbxmmglczCo90VZCkRAMan0dUUYbiwkWiCX2bjsVd1i+/CVEd/djOxN65DViYd HGVVxJfV0ZWEdfO90jfrdX5oVaqE/UB+bTuatA29NoQCBPHwT7S6g9ire81fx8tiwZ 61pMKZSdck6PEctLG8ntkCGUhm8PsFsefZyW4wdBaAIMY8x2kkW5VCSiVFjc4lLqVC C30C5/I+w5vNXVJOD2e635SINKRRoA5bKTvzRiGPwA+n7x1sZqXOV34DC7W0N+4LLF y/eurOoKcukW+56yU17d2jDsk9Vr84FufCsYdZaYkZpKiuKj4NL9WovsffvY0w3Cs3 kKd0N9evuuuCQ== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 03/18] Docs/mm/damon/design: add 'statistics' section Date: Wed, 18 Dec 2024 20:03:12 -0800 Message-Id: <20241219040327.61902-4-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: jbbmqx15gs8cdg6534u6d8rkw5qotgnp X-Rspamd-Queue-Id: 8E3A91A0003 X-Rspam-User: X-HE-Tag: 1734580989-167883 X-HE-Meta: U2FsdGVkX18lTgGTe0CV16s7+BA/PDM1khmEQGtqUgFDMtjGrfGpeDOoQyUl8nDJnI70hL4iG5kSA9K/Nb/meiKXyGstEAlz9HV3tdR/XJfeJMG5yp/tihuZZ83GwDj63EQ+gDVriy8Wu2xKCG02yTM4wR1xcY64Vp8w3zq4/z00QEXhhXMl7ji4s4RSh9tR7M8wAU3/66PqBLRTKRNxqIliABRxn8eseouyKMbXz/dJrurQxy+gyvGFJVGof4KLKEvgKbhK6ASF+N8RlOyRA2cHXLoTn3TLdfiAJqSF15mWh2sZfbeIJ7xqoY6riVsmsa7KM/ASupqvdRagfe6bd0WQF9gdKKhE1r8qev8SBNvaIGe6b/hmTn30swvFHJ8SjukdqQtepUxxtCedzXdktaSFmiPvExH7QwX3cW9mqMJ4zcl8x5b/jsQjijjrGofvZic9VAFEUKpGYh/YbXzjLFeg+wvgdSR4X7DynOO0tGGqE72Ba9oGAofpkrc1elhQ+WhlTskdfEb9R2LI3CM3e5nWl+Lrt1cJiL8P8PuxpVSXqcl75o/FVInFVrA3pWDn+4Ux8lcCTaDO61hSeKw132xm7Vt+M8O8EnB/H4NSG2rRhhY6s7pkuMxN8tGsTIGVJ2glWuhwRzkjA7Zlt30lHFEx9p3buG0HhY+thH/u07ZNYkktoM9mHBJI6B/fpItAxIvn8KZphbhWN9gekjs575OijfiUWfGYzl2Lo+aCe8HumkaTuLHvC72mLtQMuZPCM9kX9t7NtTmvVZYj0sCQj1xEnotqqeOqcfvcvSVVmIeSIIWQrAKsxSP+S0kfg8FVOZ6x3wwqqASai6eJQTuWktDOGcPbauu653U184QwpOirtYu78+IRQh725iahp86Y5Jfh1Mi1byyMSPmdOBbB6Q/mIp+DW0HZpTl8p3TUO1fiTaQ8vPwOiDEaMbycYXD5mIFemUSL3hjC5G2ZG70 exsUVNVC bPTt0qdYzrslEb0sfmGcdJtE8Fa+NdY8HhSeto1g8bquJlnyMmCqbFdzA7cvP2V2CA5WhOWs+PYNcNalmA/3yugf9GVslVBQXyYMBL8vByy6Z292tB3TYcHsU6CWrlkew0pyuTEOxve2xNWXipo+HP5o1MR9X2RaDLv06+Cc7VeLkl0wWGeTWLNoU7B2S5zGV7LZi44FhOMOFAHRPCz8EuxeUuJ6HIPIv9RxD9fBcrJC50T8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMOS stats are important feature for tuning of DAMOS-based access-aware system operation, and efficient access pattern monitoring. But not well documented on the design document. Add a section on the document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index a577ae40e71c..8710fa71ad71 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -539,6 +539,43 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface `, refer to :ref:`filters ` part of the documentation. +Statistics +~~~~~~~~~~ + +The statistics of DAMOS behaviors that designed to help monitoring, tuning and +debugging of DAMOS. + +DAMOS accounts below statistics for each scheme, from the beginning of the +scheme's execution. + +- ``nr_tried``: Total number of regions that the scheme is tried to be applied. +- ``sz_trtied``: Total size of regions that the scheme is tried to be applied. +- ``nr_applied``: Total number of regions that the scheme is applied. +- ``sz_applied``: Total size of regions that the scheme is applied. +- ``qt_exceeds``: Total number of times the quota of the scheme has exceeded. + +"A scheme is tried to be applied to a region" means DAMOS core logic determined +the region is eligible to apply the scheme's :ref:`action +`. The :ref:`access pattern +`, :ref:`quotas `, +:ref:`watermarks `, and :ref:`filters +` that handled on core logic could affect this. +The core logic will only ask the underlying :ref:`operation set +` to do apply the action to the region, so whether the +action is really applied or not is unclear. That's why it is called "tried". + +"A scheme is applied to a region" means the :ref:`operation set +` has applied the action to at least a part of the +region. The :ref:`filters ` that handled by the +operation set, and the types of the :ref:`action ` +and the pages of the region can affect this. For example, if a filter is set +to exclude anonymous pages and the region has only anonymous pages, or if the +action is ``pageout`` while all pages of the region are unreclaimable, applying +the action to the region will fail. + +To know how user-space can read the stats via :ref:`DAMON sysfs interface +`, refer to :ref:s`stats ` part of the +documentation. Regions Walking ~~~~~~~~~~~~~~~ From patchwork Thu Dec 19 04:03:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914445 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 50CD2E77184 for ; Thu, 19 Dec 2024 04:03:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A15FD6B008A; Wed, 18 Dec 2024 23:03:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94FC06B008C; Wed, 18 Dec 2024 23:03:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C7D36B0092; Wed, 18 Dec 2024 23:03:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 57ED86B008A for ; Wed, 18 Dec 2024 23:03:46 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 17554A13E3 for ; Thu, 19 Dec 2024 04:03:46 +0000 (UTC) X-FDA: 82910363550.06.8AF35B2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id C64A6120003 for ; Thu, 19 Dec 2024 04:02:58 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AlR11qQK; spf=pass (imf29.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=1734580988; 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=OCAiqK43y8Z+vTKc1SUu+jPej/COz8njgBO4zF7ZqwM=; b=ufUyRCoer4PVgBZdR1rLIzWJQHW/eVulb4HnMbFvdl6A1j6Z6DpqquWMKwhab0VAu+caDd DqKJYIJommvFgc3MQEszGg6Z7PAmmfGnxrjc0k2CVMBPIf6EvbXTRCXYDS5n6lVpqNc9Mz JtmsH9A72JDD1B4vOjVH1S72Vgl/OxI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734580988; a=rsa-sha256; cv=none; b=VhyA4tGEzbwcMT+/Uf80O9KvYGf2+bhZunEVQLuxB2IVQkN6CBlRaLQThF/xrdbASScNXT QTQ/wRfkBRa3v3DOA5/1w/J1NTpQ87D+CSlJK2LCorXY8xkwW84UaLkaXNya6aiB5IpnVV DIVyOcr8Q9/GuYrRebfGlQcCR6CfmOc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AlR11qQK; spf=pass (imf29.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 AD6635C6640; Thu, 19 Dec 2024 04:03:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 636A9C4CED4; Thu, 19 Dec 2024 04:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581023; bh=870oJTBXZdVt9AT5feGTAshGBO42oNB2tnBh+kdf9pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlR11qQKkpzyBTQiNLszI6jcdKv/J1EWDO9SjdrivcgOlH5rxhbckRGbfZe2FbiaM a8x4tU2XvnmKsuiGDsK8gF/whIEhzVaXGsbJDgQk4AfZJrYbonz2kx8zbUAg13Kp2B 9TZwVLkhLuPW6CzZpL5Xw4rxSqaGTfgH0byKfAwsAR6agFFyc9LHSj1Y7FC0KUexGJ 70R0u8m3b2edUS2OxLyOMeWognAaGXuwyRsgB3LsoHGkiLiyKELVULuSsEhpg4nQew l8c22bHynMak/3i/RggiuhQUNOYJYzJJwGVn89+oD5LiGtvwE9z//yNT0t+ab5wcDe d4AHq3FbGrKCA== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 04/18] Docs/admin-guide/mm/damon/usage: link damos stat design doc Date: Wed, 18 Dec 2024 20:03:13 -0800 Message-Id: <20241219040327.61902-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: C64A6120003 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: d5qhcurt81t83jjh8w9jequ6k5nqfwdw X-HE-Tag: 1734580978-973190 X-HE-Meta: U2FsdGVkX19swmkecBgzwGXLRjhKcz7PL0LnKlZbMpkjPxutETYb54g3KvrHP0hwj1K+VGa0UF2DmvjSL0ojKu4nSkaHPU3quycKwQVjAau2qlcIP3iHzIxE4HTdmNf3mblhgYU+6RADWh4S4/dBRX3TX7+kXofyqGb0qGE/PY9iIvpXMEZVX9W3pm3jcrqZ6LHj+ebOsqebkEIeI4nP+6MmozdHpxxTI/Bvba8vOr+kcczgQybvNYzKWwdenxWUmY7M9aUjpbKbMP/WCGVqGzjJKKeEFI3zF9MXo+w6urWPdIthKWRPHMILXQ6EQykXT5hqOoseDXWwB77GMYS/YpQjK8RCsgzSHLLkwQ8VfSQqqNXBiHWkOJkw2+lisg2l+Oo1up7j/ppFNXa+RzQ96Lq+HzMQSk5szhEUJb4HIWchcg5x42eI4HtD1dCf137/M1kokIEg+2x7QI4MLC1nc76XosFQBjY8LdFkjCqdOUFVKsx3XiyF6JM/0FkDei5HACjvTGk5U4EtF3/Idi81xIGr73z0xV4Ex/CtcCTJ/4Aq8wUD054Tbbq4r/koAHsYFrkDUYFXPwK2S/ebBXQBaSPRL9PQxA9ZPdVlaxQ7drTtQ1xumzgcpqIqF7iSF/fzE1dLCr4O9O0T+0+rNNYve62ocidUvALmEQOssxl/efaXCCMHA6hNfoHm0uY2yp8uE8r8tZ7GmwK6icZDBgGic5HJMv8yDL6d2qZ6DHoJNo0k7fQZmGTMn3ctClnzpEOgCOYJARCklL1Zeafb26QURmDS0LVBRnPHFvoywk6gkunBAK/K0QDKm1hiwggYpiD5AGTrc/bWksSEBbDkxWpAYrF8+ZfzX3wyzU6X8h43yoXFqdre2hf9dZcqYsYtyJwi7G08yLBAvxGPlChAzJ1Hz/cnEZpTxCTcMrLI696TcucDp9bVhZKRqQowuOhSEzGg+fgnY5f2EOJoBKyUpq8 M0E9TSgh AUP9eHBIACVmpDCmkKOUt4k/i5PCvPpbJv/f/bukU2CalG8emrUeQ30Ur6N6OkBAyJGov2vgd5ObwaeWcriZERuuvDBRhuTgWJF4B5d9mxxFkhvRX9Fi3nd+xYqgoSyHMlkkRXjbg7GsI8YFkAlFhS5MkaKU1NtUGx9usVlik00apyKuL2mAFjLminEiZ3/dZhXI0uMc7JdawFJqEbS0s2a/Zn703KRme1Mm1Hoj40YENzSOXQ69pC7oIv8xYEG0Zgna5FREkePQQk0c= 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 sysfs usage document should focus on usage, rather than the detail of the stat metric itself. Add a link to the design document on usage section for DAMOS stat. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 3 ++- Documentation/mm/damon/design.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index d9be9f7caa7d..af70f7244700 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -457,7 +457,8 @@ schemes//stats/ DAMON counts the total number and bytes of regions that each scheme is tried to be applied, the two numbers for the regions that each scheme is successfully applied, and the total number of the quota limit exceeds. This statistics can -be used for online analysis or tuning of the schemes. +be used for online analysis or tuning of the schemes. Refer to :ref:`design +doc ` for more details about the stats. The statistics can be retrieved by reading the files under ``stats`` directory (``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``, and diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 8710fa71ad71..e2666124e382 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -539,6 +539,8 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface `, refer to :ref:`filters ` part of the documentation. +.. _damon_design_damos_stat: + Statistics ~~~~~~~~~~ From patchwork Thu Dec 19 04:03:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914446 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 B6B49E7718B for ; Thu, 19 Dec 2024 04:03:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD7576B008C; Wed, 18 Dec 2024 23:03:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C868C6B0093; Wed, 18 Dec 2024 23:03:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B23AA6B0095; Wed, 18 Dec 2024 23:03:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 922D26B008C for ; Wed, 18 Dec 2024 23:03:47 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4A9E71C7E33 for ; Thu, 19 Dec 2024 04:03:47 +0000 (UTC) X-FDA: 82910363592.25.41E3529 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 02D5D140006 for ; Thu, 19 Dec 2024 04:03:23 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iTssS2WH; spf=pass (imf23.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=1734580991; 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=wGRTTw/mPkqf354FJQdjzpd4vfVVMZaisaA5YWT1/Aw=; b=DgIkVc0maYzdo4aHxM7m588uQjf+pirCDb2L49B0mLhNAoYaePmWFClMi8aKMfifdVs5Fx wgxySRFQPp1Kh9QDUDnZ65WEnEhqf8Mz7jpqN6S+VD/7nddTfZ+6uEIzPSa3A3wMrC6UlT /ESPxIVbxdaSfJxu+ZKzqtqor7R7gwo= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iTssS2WH; spf=pass (imf23.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734580991; a=rsa-sha256; cv=none; b=0NZ5ukzcZojaIGW5aIaOzUQAAFqBQ7djiBM7Jt0lxXllfLb99CBfckq//rFguYkZAkjaq1 o+viIJ9Qn4D0mqupzlB4zO1g/3CjZsPBR6rFPzV9vqxm7UQyelPxlhrcn4mgV1p+SgzvJq 3wYhvWv4X7l3M+kxo5qlomfZS017Lq4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E45A35C6633; Thu, 19 Dec 2024 04:03:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75B53C4CEDC; Thu, 19 Dec 2024 04:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581024; bh=cxxjnWzTe5muZlyce9kFDTQgXHn3SHgY8i5MGv2pqZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iTssS2WHa66nMxFXS8zkggEJKRiPlZhTv/5Zpsv2QxVDqaGQA7KH7vHCko5ztski9 OQUNAnp+dZB4iXhLf91mAESi/UjJPsCHf4hm4oa1aKv1fZAKrw9imbq2C4AJAtGHhn Pm/XbpgXz8TKmBurz16QCq4Iko9WWZfU8KDyx6Kf3KCT+3PCt/3dkZr9aao31ut32R ZNNjgsBhnwvAgruO6gbWm+XvlSl9FNcTmXLF8GJ20Hbig3tVW6ccrAgQlVF5ZK+h7D ACT0lwhXKmci4+z4wTfVMPehGxkoulRuz6U+s9TYHvbrQdbCjCJ38PdPnuMPI2r3F1 jLOzvmSj+I2bg== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/18] mm/damon: ask apply_scheme() to report filter-passed region-internal bytes Date: Wed, 18 Dec 2024 20:03:14 -0800 Message-Id: <20241219040327.61902-6-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 02D5D140006 X-Rspam-User: X-Stat-Signature: p5qjicudxa1d8r3k4o7uir35gqy61ynw X-HE-Tag: 1734581003-568792 X-HE-Meta: U2FsdGVkX1+7KvceKTRME24ccOesJG7sOlnvNG5rRaYzSn1J2eW6I0RUIesK/k8dr7+ce3H0B5FJp0vmKkXSfFCOy9fYh3OWdPwGbSnWzQWsUZBnqhc9ppuPfeVvRlLEBq7r9qJ4EoQs44awTdt+Jl5SS3giCcfCCHSBtawFijDiTP/6CXXFrv5q8ymlQ3YMPL2da6+IbsgU8Z5yyxlakidTila0f9twpxSmCXKmk3W+tek/NhxtkalMYiFeMLnczv55+jK4jENhjROYE53iPgXY9FDEe1qoci17Vim+sHj/TG18Lbkhrsti86hx4y8vQUlL7e5lEufSClNcC2xHWC9sfmP+hY7mzf2TB/ODi/l0Kr9k4kHK+P/2IrlhmipMV1ayTVotc1C/8KeLw0o1xPgVnY/0IZ8j3sywdsHHmiMWYSp4remQj3wNN2bNOlO5aG3njrKR3y4Yt+MKtsDGlnkd2I6IfCnjTQKcY7thJUaLSlBnO+eiJ35AjjNDumFybNkERLw1uw51bIq+/23VJTakZczmxCPua4SorkUQdX9qqKDMIxz2y+aMrltW/+CWJCJlHKNcYKal4fDecLJU6w2eSdzBuNnX1F4eRFw+Rrww/mZukCLw3e+PuTPSAWbY1YrToLRvq8fbeIQ/wyngcR/5061XUpTifkc04Vndni3XLMf39CGkHfvyXrSLrfyYkEoWkfmHGSbOxS/EWYKNqmjIQWSItWP4zcsoCMIYPKMpBn3inDKy0WJJgi1A45oNxA3I/PnqXQVr0N6enKJUt41LGgN1al29B5yVXVN3MLqAB4JsTkPZ15lkRKi03ShaV1Dp9MQBKRS4vanj+dXLHbXTXUMV1BaScc3spcKFBMfhJk9FGqQ1YZItOtqtvge40LCjTnuatTXwltWZSwsIA3t70uEFuVZ+Lt53nBUBToyGa1YbpV6lllgOb6cnC9dSmEhbBm8yH7OGCRvyys8 5f5wVr9N juFB5KQfqB6YwvReIR7LBz0eDOThNasICL3+uehuRDc1hDotwl0hhhnOR0lzdIjfEXsFYYer4nLP7qurzgPRwZKFLxiA/DAYxUolUZXltxOclfDg5ZR6ZZDosDxcERd3eRALo9nUAd5zbHeI/vuzLCOeZTkg/31/jQXzMVD3Y4+ksLTbjZM5XGKptQ19cq/hlO63R8+nX4OlPEUDMF8QYC/UCZiGTCkMWIEqtNQrfDkBCWzSUTobU4XYkjACLZ6p//pdKi5s53agCU4v6hdjnobXNxw== 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: Some DAMOS filter types including those for young page, anon page, and belonging memcg are handled by underlying DAMON operations set implementation, via damon_operations->apply_scheme() interface. How many bytes of the region have passed the filter can be useful for DAMOS scheme tuning and access pattern monitoring. Modify the interface to let the callback implementation reports back the number if possible. Signed-off-by: SeongJae Park --- include/linux/damon.h | 5 +++-- mm/damon/core.c | 4 +++- mm/damon/paddr.c | 2 +- mm/damon/vaddr.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index f66fa0ab9350..bff39c23f16e 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -534,7 +534,8 @@ enum damon_ops_id { * @apply_scheme is called from @kdamond when a region for user provided * DAMON-based operation scheme is found. It should apply the scheme's action * to the region and return bytes of the region that the action is successfully - * applied. + * applied. It should also report how many bytes of the region has passed + * filters (&struct damos_filter) that handled by itself. * @target_valid should check whether the target is still valid for the * monitoring. * @cleanup is called from @kdamond just before its termination. @@ -551,7 +552,7 @@ struct damon_operations { struct damos *scheme); unsigned long (*apply_scheme)(struct damon_ctx *context, struct damon_target *t, struct damon_region *r, - struct damos *scheme); + struct damos *scheme, unsigned long *sz_filter_passed); bool (*target_valid)(struct damon_target *t); void (*cleanup)(struct damon_ctx *context); }; diff --git a/mm/damon/core.c b/mm/damon/core.c index d8c223954996..c7ae95d6b7ba 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1517,6 +1517,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, unsigned long sz = damon_sz_region(r); struct timespec64 begin, end; unsigned long sz_applied = 0; + unsigned long sz_ops_filter_passed = 0; int err = 0; /* * We plan to support multiple context per kdamond, as DAMON sysfs @@ -1563,7 +1564,8 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, if (!err) { trace_damos_before_apply(cidx, sidx, tidx, r, damon_nr_regions(t), do_trace); - sz_applied = c->ops.apply_scheme(c, t, r, s); + sz_applied = c->ops.apply_scheme(c, t, r, s, + &sz_ops_filter_passed); } ktime_get_coarse_ts64(&end); quota->total_charged_ns += timespec64_to_ns(&end) - diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index a9ff35341d65..3530ef9c80bd 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -477,7 +477,7 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s) static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, - struct damos *scheme) + struct damos *scheme, unsigned long *sz_filter_passed) { switch (scheme->action) { case DAMOS_PAGEOUT: diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index b9eaa20b73b9..a6174f725bd7 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -655,7 +655,7 @@ static unsigned long damos_madvise(struct damon_target *target, static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, - struct damos *scheme) + struct damos *scheme, unsigned long *sz_filter_passed) { int madv_action; From patchwork Thu Dec 19 04:03:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914447 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 48EB2E77184 for ; Thu, 19 Dec 2024 04:03:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97A3F6B0093; Wed, 18 Dec 2024 23:03:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 92C1C6B0095; Wed, 18 Dec 2024 23:03:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C97D6B0096; Wed, 18 Dec 2024 23:03:48 -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 585226B0093 for ; Wed, 18 Dec 2024 23:03:48 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 17843161336 for ; Thu, 19 Dec 2024 04:03:48 +0000 (UTC) X-FDA: 82910363886.30.84AB18F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf06.hostedemail.com (Postfix) with ESMTP id 8A26D180007 for ; Thu, 19 Dec 2024 04:03:23 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iUXxuYoz; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1734581011; 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=HhVcQEGzGH+TRle20lu2J+FrSlhsgAp2yCmZVzwMIRk=; b=5vXnVKoBMuwVbRB+3GJtFdOGoFpfINLIRjd2IAlWcPRckeNudGuAEmHVXScnD0i5kG5cYS 6OWCjdCNlVbjidlHsC2+hC0JEgfbqAlIsAJgyOR1ooIgdsVvp1YbibP/nYoCPwDkAH/Tv9 8d2UA52gtclNoTaiUNYzPBGTWcJoZMg= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iUXxuYoz; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581011; a=rsa-sha256; cv=none; b=8P9vJv7KCysU0H1Px3RiW+YGKEXqpL69ZzmOgI7sF9PByOlXrJSJ0yf9J33+EswiGAFP8E X2eDXKLzXj1uMnw8CU6VZmmtbnSEkmpE0pntCVG6bCte10z6IjRxtLZZSQfTFZk9uO5ZUY C83PqxRh3C6J7m5hDIcF7kHV40TIQdA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 49617A41C12; Thu, 19 Dec 2024 04:01:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 841BEC4CED4; Thu, 19 Dec 2024 04:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581025; bh=qRmiCMizOQQeo+/I858Y/f5o5hnl0HiSgoRowr7L2/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUXxuYoz0GNi9lf9CHZM18zuewqVRNsYobwBykPHSYrMV9AgbT2ibgoGTL7yCHIs4 viP8pP4alQGmgJSLHf/I5LsPUACsFYRzpQicIDxhcro7F8wUnWsW0QJrKrCo8NgoEk HUscxtnN3hWLtn3zVIU4krkMQI0vt2dDIKyl6z1/+gNxTaVQamtpETRyvHw3MeDDUQ JG0qHKEokMfFer8zvAjHZZ7iuDhZgllJPQNKHeJp47L2I30y/9tFFNYIYx6/XbXuCJ 5+Szxy6CAkRdObErvHvP4QfbdqQHcpOeXfMxFVtN3yJgfhJubzqYydJoFvAg7koQuU F7bPo+Gki1G/w== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 06/18] mm/damon/paddr: report filter-passed bytes back for normal actions Date: Wed, 18 Dec 2024 20:03:15 -0800 Message-Id: <20241219040327.61902-7-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8A26D180007 X-Stat-Signature: r68r3h5335jbik4ibzqh4rc8fnexn1ex X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734581003-951849 X-HE-Meta: U2FsdGVkX1/3Hhxf14/ROnWvpwKSJE2f+QksFFauLqnEI6/YW3W3GP5gdzptJlNcpPu1gGeQS3XmjZSZlUxbU6r+oyDBNdCvp/PIukMc4xL81P8mgXazV190B2zHaA/P7mrBdDHuXummqQwdnoSW2Hh4qNaM4/kOIwX6sM0gDNrFK1lSD3dpYE/cOnDzzf9qic32Toh0Xn1U9kbiB7zZ0wrkRPBvpqDrEnl+1q8Zhyqkg+5DECY/kpESrwng6X4fswGAW5WVD3RolCPwg416LWAiccBXe+L9ztMVMb7GGWmAvJ5OAdkq9gTsQ7+7n/J92hBeMb5PqMYalwkm1cZjZkh3D+lf//DuH7kj0Kbu+9LPDCcXgUJQ7oZl4jPlEIlBCZV56cF93PsJROGel6racA+s+xog8ZEQape7FazsYsfKIQh06mrc7RpktKDJp3fN9NjKRewvpwwYwodduu1gKXnv6tt/ejnqVeE7DEKq90B2vvfKJY4woMJARz7ib+IcJR8n2Vp8c35AGJW2y2DvjZzEHrRriMBfVARHllW1BXyd4c5qxTCAMSNyOjyU8uF9VAEz07urYlTuJ9rzw1eLBXb8iLk5DNz17FCoD2W8n8jCdKse1pep0LAa1fHauC0qIuc26fdQ6/wKlrq851KCdHVUaqw1oeB8t026mf29qKApHBZegAew1MaWHojaLxOaDiGn59vzqht+/vC5+QK8JMa8+WTLHy89URE1CtuRsPwr7AB6Xgs9GlrW8XxyK9+rFU3+qVhOy4nXGIEcd/f/L9jLio1zo1VuFYHj+EffnEFOqYZsO0gPmbx1vFA93Rb9hvOuBUV49PrgUyt2MTDPaPVKeIjDdkrQSe3tCIcWCjZSGg1SKO0qgxqdN32FxAohYdk0/ldZIT76CFQPBcWO7I9maeNw2qGOeoe73QiBuM8r7RQe48vt6G2SZRu8sPGckJtuP5L1RJoZqHzA8OS q80l2hop 4Tbu6zEn5JNf3085jVHZxC5LGaul6A54F7WWyJiX4xExEY9B99xNzVrt6wiT9DN1MtgqIHE57Q5lOb+esie0C1f03+LcXAUf3aS0h3Pu6QCQ9BimC0pz9pI1QYP7x89DaPxq7ux9qqyZDZ3X9wQOQNB6fyjdzQ6rIDe8eYzmL9ly+rZvpnscP62gn8Y0tvkW4eKWlnyvTynwRhSG/zhD20rDYgu9oA4e1lJZRQ9bJVTvBor8= 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_operations->apply_scheme() implementations are requested to report back how many bytes of the given region has passed DAMOS filter. 'paddr' operations set implementation supports some of region-internal DAMOS filter handling for normal DAMOS actions except DAMOS_STAT action. But, those are not respecting the request. Report the region-internal DAMOS filter-passed bytes back for the actions. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 3530ef9c80bd..5944316a0b4c 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -243,7 +243,8 @@ static bool damos_pa_filter_out(struct damos *scheme, struct folio *folio) return false; } -static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s) +static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s, + unsigned long *sz_filter_passed) { unsigned long addr, applied; LIST_HEAD(folio_list); @@ -272,6 +273,8 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s) if (damos_pa_filter_out(s, folio)) goto put_folio; + else + *sz_filter_passed += folio_size(folio); folio_clear_referenced(folio); folio_test_clear_young(folio); @@ -292,7 +295,8 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s) } static inline unsigned long damon_pa_mark_accessed_or_deactivate( - struct damon_region *r, struct damos *s, bool mark_accessed) + struct damon_region *r, struct damos *s, bool mark_accessed, + unsigned long *sz_filter_passed) { unsigned long addr, applied = 0; @@ -304,6 +308,8 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate( if (damos_pa_filter_out(s, folio)) goto put_folio; + else + *sz_filter_passed += folio_size(folio); if (mark_accessed) folio_mark_accessed(folio); @@ -317,15 +323,17 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate( } static unsigned long damon_pa_mark_accessed(struct damon_region *r, - struct damos *s) + struct damos *s, unsigned long *sz_filter_passed) { - return damon_pa_mark_accessed_or_deactivate(r, s, true); + return damon_pa_mark_accessed_or_deactivate(r, s, true, + sz_filter_passed); } static unsigned long damon_pa_deactivate_pages(struct damon_region *r, - struct damos *s) + struct damos *s, unsigned long *sz_filter_passed) { - return damon_pa_mark_accessed_or_deactivate(r, s, false); + return damon_pa_mark_accessed_or_deactivate(r, s, false, + sz_filter_passed); } static unsigned int __damon_pa_migrate_folio_list( @@ -449,7 +457,8 @@ static unsigned long damon_pa_migrate_pages(struct list_head *folio_list, return nr_migrated; } -static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s) +static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s, + unsigned long *sz_filter_passed) { unsigned long addr, applied; LIST_HEAD(folio_list); @@ -462,6 +471,8 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s) if (damos_pa_filter_out(s, folio)) goto put_folio; + else + *sz_filter_passed += folio_size(folio); if (!folio_isolate_lru(folio)) goto put_folio; @@ -481,14 +492,14 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, { switch (scheme->action) { case DAMOS_PAGEOUT: - return damon_pa_pageout(r, scheme); + return damon_pa_pageout(r, scheme, sz_filter_passed); case DAMOS_LRU_PRIO: - return damon_pa_mark_accessed(r, scheme); + return damon_pa_mark_accessed(r, scheme, sz_filter_passed); case DAMOS_LRU_DEPRIO: - return damon_pa_deactivate_pages(r, scheme); + return damon_pa_deactivate_pages(r, scheme, sz_filter_passed); case DAMOS_MIGRATE_HOT: case DAMOS_MIGRATE_COLD: - return damon_pa_migrate(r, scheme); + return damon_pa_migrate(r, scheme, sz_filter_passed); case DAMOS_STAT: break; default: From patchwork Thu Dec 19 04:03:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914448 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 9F1DAE7718B for ; Thu, 19 Dec 2024 04:03:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3B526B0095; Wed, 18 Dec 2024 23:03:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8F936B0096; Wed, 18 Dec 2024 23:03:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 927FF6B0098; Wed, 18 Dec 2024 23:03:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 71EE86B0095 for ; Wed, 18 Dec 2024 23:03:49 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3B13312109B for ; Thu, 19 Dec 2024 04:03:49 +0000 (UTC) X-FDA: 82910364348.16.FF6C361 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf30.hostedemail.com (Postfix) with ESMTP id 6245480007 for ; Thu, 19 Dec 2024 04:02:45 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LLwCY7XC; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581012; a=rsa-sha256; cv=none; b=ht2w+ukdiQdQSiIR3PTyH82YxX+Eynj7fCUD8yQZ9avHiOnd16r1uBDFSobqk3vRud/CgW m85i4tfDF28I8/wOHNqtOFGU8g6Aia48OLJ+RJ3zZnz7yq1Df1zXgmpsZIFCJT1qhIUlFa pJDMvfNV1vGA+PCfiOv7/e/8bxJ74Ys= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LLwCY7XC; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581012; 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=ry9mD2QkDiun4VCTmB90Ymzq+2NDMvQYWdeKqnhReVI=; b=vXf+GgQt4Duyv8Hdd6O2Z26JuFd2XTuGhc0ysSdz2DXr5J25jpvnGA2KEv4ewKlDAMpSZa lAnOse6bXI9zI4W9NapOGFH7Eu/JkFr8uyyGkbCJIaR23nBUsN/kb8APxrGyx0WvttgGbv AcH8iZvCI+0zsx0sNbz+yrLoPzx8o2w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EE0485C65E6; Thu, 19 Dec 2024 04:03:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3310C4CED7; Thu, 19 Dec 2024 04:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581026; bh=v/ZiBRKbfbEykvCZNndO3AyZ9fQawvkE+ZCwqKdxiC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLwCY7XCrXKLl9hrAIUoT8AM3rD7urUs/LxhpOgzcOc44OGsZAqdYBpczJLDfhqQd Ugn8zdzXuyFUXipe/UpgChq1b7JY/NSSHKYsY68x4fZXAormDkhvVroMcIe/ddmgPk D5agXjvf1pgf4EYBd60zHJfO5mxdeXSSJmE5+Y8ed9riJ927yCogDgGJb799JENyTg 3r74323OuSU6EHo5GhuZ/lCwdOUEnyVMddvXdn/N+WZKizVT590zkYNkgQURdZIeMk DD92sALUgMeLD5Zl1PeFhKkK30JIS8Ms3XQIYkLfaPg6jF/Hh3ZXtVFtLlWNZwSfTA r57yPAYktc80g== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 07/18] mm/damon/paddr: report filter-passed bytes back for DAMOS_STAT action Date: Wed, 18 Dec 2024 20:03:16 -0800 Message-Id: <20241219040327.61902-8-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6245480007 X-Stat-Signature: ztbsn89qyrcnu8d35eu9y98szjq8gyj3 X-HE-Tag: 1734580965-495915 X-HE-Meta: U2FsdGVkX1983LhcNEmNIEs48uL/BOB+2ywk+nDhQunjtT4S264BonPqiXDUglyNLZTMXp0ObSBh7tz2praDBpfVPVnhRM+1bwd8gzJ5WiHBLMb6lFpJlqD2612BwdtaXAshOhrEFDnvblRZKgUByFDKAEK/Fref3Xklytzsk1o92iF76zYz/d00x1+MZoZF+Wh7/4Bo3GikFcxSwvzu5DEmuPl88Pat1toqVJpNKyE9q2D+Vf3CslRx89RvFb8UFYCGg38VUNynoaISlZHPVwEZ254+/s9Co203KmSzdIVpABWIkB1Cj89WHBVuolWnOIOvKl6cg5+Miq47UHE17GHicfOqYWtdKB2hB1mqZvi9rXpcHCHU0iT4C5LlvAVuHzZkh27FTbTPg8K1KM8tLPQ6VLTwEs9ksbco9/HLoyMqNoObc9PZMaQ4Eaxi4xQ4NMG7+NFp8b8niC2IK1gjxWESx54QQbc8jv11wOLtIEuFMph7QWaiMG+Qd78OSLG96//w/4Gt1Jz7BQLPUKm2ZSDhT44DqXI6KgxIrcFpTRXmtSsVC5nvdUw3OgidXKlaYrGeFgZRB88G/2OHgoVKq472Q/Ni2eMNkB7XjAYGtnQ1OmeWEUlyFEY8cvdICoO5fZJfx/9WB4zbkDucaYMp4PMt0oWflnCDZXAsHg3zg7Vj0annn6Ai+/eMzPamIgca01yNMZO95jhHTW9Tsri835D5PtsoGz9jXUYQ0fmKpi3WkfAvKqhzjE4RzZ6CsxjKrwiWjT1So+nf1fZT9Hoy31aDOR8gXa7MbNpoi6RhVtA449/8sDYfG/1kczESXtKpf+soLs4/Qzy+1txo0Q/i9Uu/jCD1qcsRXHCoN/0YYbUfYXOFMLzjYv18NJboHOCFKm/tNA1cagURFEG12uucmkYd6N/SiP+CHBuwg0r41XKQEfwXC/3/DDbXO2X3goaXAcd7euWXml+JcROn9p4 z/333Np/ v6ebqZam4i8L+6czmtE0Ehc3g/YUfRpZhmoxC0V8mXt2LvPZkGvhibCNJaeRCu0sKiZ5HanRIBqj1c+zWVmv/p7eR3dEC5cwdx2gmshnzyMPDRmfmlRWLgRimKapo40D5csSl9YxRpn6gFVWJZOqxwRxI5l/Urye5dq923U/ywaLEiBKpvrKK1PHsGmjJePs5kchYuehZ8cGRtaoUaV43Qjh3qFOHkj4D3gK7RcwJzxdDC+6cx269m+q3Uk3Z521n30mRIYLf16+dfjk61qeZbdAO0g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMOS_STAT action handling of paddr DAMON operations set implementation is simply ignoring the filters, and therefore not reporting back the filter-passed bytes. Apply the filtrs and report back the information. Before this change, DAMOS_STAT was doing nothing for DAMOS filters. Hence users might see some performance regressions. Such regression for use cases where no filter is added to the scheme will be negligible, since this change implementation avoid unnecessary filtering works if no filter is installed. For old users who were using DAMOS_STAT with filters, the regression could be visible depending on the size of the region and the overhead of the installed DAMOS filters. But, because the filters were completely ignored before in the use case, no real users would really depend on such use case that makes no point. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 5944316a0b4c..b0c283808ba6 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -485,6 +485,39 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s, return applied * PAGE_SIZE; } +static bool damon_pa_scheme_has_filter(struct damos *s) +{ + struct damos_filter *f; + + damos_for_each_filter(f, s) + return true; + return false; +} + +static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s, + unsigned long *sz_filter_passed) +{ + unsigned long addr; + LIST_HEAD(folio_list); + + if (!damon_pa_scheme_has_filter(s)) + return 0; + + for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) { + struct folio *folio = damon_get_folio(PHYS_PFN(addr)); + + if (!folio) + continue; + + if (damos_pa_filter_out(s, folio)) + goto put_folio; + else + *sz_filter_passed += folio_size(folio); +put_folio: + folio_put(folio); + } + return 0; +} static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, @@ -501,7 +534,7 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, case DAMOS_MIGRATE_COLD: return damon_pa_migrate(r, scheme, sz_filter_passed); case DAMOS_STAT: - break; + return damon_pa_stat(r, scheme, sz_filter_passed); default: /* DAMOS actions that not yet supported by 'paddr'. */ break; From patchwork Thu Dec 19 04:03:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914449 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 0BE48E7718A for ; Thu, 19 Dec 2024 04:04:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EF026B0096; Wed, 18 Dec 2024 23:03:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0084C6B0099; Wed, 18 Dec 2024 23:03:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE3716B009A; Wed, 18 Dec 2024 23:03:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B716C6B0096 for ; Wed, 18 Dec 2024 23:03:50 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 81F2D1C8358 for ; Thu, 19 Dec 2024 04:03:50 +0000 (UTC) X-FDA: 82910363466.03.52CB7F2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id 95BE918000F for ; Thu, 19 Dec 2024 04:03:44 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DBmQQXmZ; spf=pass (imf24.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734580998; a=rsa-sha256; cv=none; b=U4xv1PNFhms4dpjWwn8ZkBMtmxArPTH7phYg9d0SAOL6A2i0FqAMhpGMXSuGdDyToc1J/J 1eqizHLChJ6JHyGwgTqH6nwjZJLcz5kLTPCUDRBZ0uTa8JFDQqe4VHI+CHi6JY2kKEpH6x hWLY+6HlT0l/UDwEFdhEw1f/21bakXU= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DBmQQXmZ; spf=pass (imf24.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=1734580998; 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=oc1IgQR2qQmGhZfUPUK0JUYmgfSMjZ5sZN8URZ4MtOo=; b=HPg5pMw65/gHVknIqEe0vX5TOdg4/6Nw9XV2exx6vXLfMOJCR9QQplYGGwGHy94dVS9FsJ qwkN8Pc1M/KV2kgDuPDYWqxtCJiM+ThVfuTadiS39ZM9GFGDHlAlGbv555b9MSg400+VQx D7s5VXJKjuLMlVCRto5fj12SXcL4lQQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 259595C664E; Thu, 19 Dec 2024 04:03:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D239BC4CED6; Thu, 19 Dec 2024 04:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581028; bh=64D8a6jEKpsztUjzJW7u7/dJMtao+tMWa0luqj3yM0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DBmQQXmZIOIzv5rl3Sq/NBNabDLR6GahdM2WjV4Ilu0m0t00lMHKeClh3MFv8z2Qy +sIXM5KGE/KBmNlWN7szTk8ucFGmzSRWp8Wmewl0/Dhr1A1vLEL2bd4D3I0LyRreVV PrZIr/PctZNuWPZwMzNxn/zrpr3E1Zh0DCtst3435UjDHeWAQqXByNN3HBUYKEsGZe aB3TtSjRyZ0CQeu1cC2u9vDYqYqB1jwW+cvNUqlTFIfG5cLuUknjpkaodwSKbfDIF+ FrQP77iHzd8QeOe7WMPUl0sHVFXFJjY3kPT+YAAcv5otXGHeHEE9jv1qgdrpJH3g/l wC8CNBbAKoWmw== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 08/18] mm/damon/core: implement per-scheme filter-passed bytes stat Date: Wed, 18 Dec 2024 20:03:17 -0800 Message-Id: <20241219040327.61902-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 95BE918000F X-Stat-Signature: g6r7qjpq1j17a46y8au4sadr4oinbewy X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734581024-321675 X-HE-Meta: U2FsdGVkX190DzMz+QuZnb5j3Gi0ilx1JjTPyCcDZmbf/jxedaxxAq2uROC3WqVQ6wbp/MpoanIjxOT3v7NZ1tu7xYaPrPOJ81hK01eWzjpOwlfFggD/UdmHqwoLBOwO+4YPe3FY9h92p6McHR1aDyQmiuhOgvK/oivL3L79f7I44cezfSFX5wQTu0aHw9pYbVqMxywPK4ukl6AWvf98Mrm97JUKrNTIcZQcUiY5nvYp7A5hg9EBcGQIDjUnBw820jDaoqL/2TicckMzpZ9XK9uwOHKaOtn1JM/oLNpawKCGNb/X+RXy0F+otWjW0Xc0W9Z2Tw8G9RCxcpcc1dn/VRmPRt4Zp6F4iuyBHkUExotyI9QofngniU9AXaFbyPcfiS0nG8+TcfNjFLKhxeUvdHAp+baw9g3YnnfiC7b+Ad7ErGv4Pe4aP65GToF8JfoVeOv0naa/L3Hf6hoj4RD3oIIbZ7GFfNxcnlfAJL1uW2m6kMOMY8hlVhsdSCkru8Ooosi0aQ3xQNiJTCi6ju/DnPFxw4j2n6GOu8Q6A7HLghQF2+pbNBfxjWGzzwnmpS/z2N+bGAJbxm0snzv0UyIrsq+s73dSUVbow3pXDg+1A17Ya+rtS8AQOsf8a7Q2093vLdDzd+FCs32tLXPcEH2uMCJ54c8a4Mzh4jqYOAfL4n93zHf3b02ho6OHmWCZx2hf2mPwHHXTUgn69SIde+oaSshSg9VRQUpHtoPbbjVg6fL5vV0SGTioUusABeI7TL27r2k75pbKO8IO+BjjcE026UWSWvndrkFTZlblvXF1Wy9f7saYh1vLC9WbD1X+OoAIZz2NJ01vQwPt8iIYENd+JNr5XFizN5F6ncdrCo58+d3n25VHX2g1Mr4sZ+xFr7DK8XMIUvRWn1qZi6NA34YvydMdXeFv4lseLIB/QpQhd9PpqFYH7exVelnMuchZQFfMq4K3vexWxfn5J+XzxTQ u0INS6k+ VAf2mDSh3QIp4seRBdg3M4LTGjAqWuEKLhdiH7BHY9/Ppf/SjNkOlc9CVip2ry7QaU5qzB2cZQ/t9A37NiS24D00bjrHFgCwk5PCVSvAfcqCBJG95HDkUB1WFW2Z6AXL8tAQLRyU0Btl+M2tJ5dkRKe25qNWAs8x/I5/miDviWc7jji3vr0uhBjrFTa9vnVsR7grGkMXpDH94mSS5e6PZ69y6so8Zzgx7magIwZUhk7SDjsY= 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: Implement a new per-DAMOS scheme statistic field, namely sz_ops_filter_passed, using the changed damon_operations->apply_scheme() interface. It counts total bytes of memory that given DAMOS action tried to be applied, and passed the filters of the scheme. DAMON API users can access it using DAMON-internal safe access features such as damon_call() and/or damos_walk(). Signed-off-by: SeongJae Park --- include/linux/damon.h | 3 +++ mm/damon/core.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index bff39c23f16e..4a68bb38aad5 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -291,6 +291,8 @@ struct damos_watermarks { * @sz_tried: Total size of regions that the scheme is tried to be applied. * @nr_applied: Total number of regions that the scheme is applied. * @sz_applied: Total size of regions that the scheme is applied. + * @sz_ops_filter_passed: + * Total bytes that passed ops layer-handled DAMOS filters. * @qt_exceeds: Total number of times the quota of the scheme has exceeded. * * "Tried an action to a region" in this context means the DAMOS core logic @@ -315,6 +317,7 @@ struct damos_stat { unsigned long sz_tried; unsigned long nr_applied; unsigned long sz_applied; + unsigned long sz_ops_filter_passed; unsigned long qt_exceeds; }; diff --git a/mm/damon/core.c b/mm/damon/core.c index c7ae95d6b7ba..8540e8f91260 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1354,13 +1354,15 @@ static bool damos_skip_charged_region(struct damon_target *t, } static void damos_update_stat(struct damos *s, - unsigned long sz_tried, unsigned long sz_applied) + unsigned long sz_tried, unsigned long sz_applied, + unsigned long sz_ops_filter_passed) { s->stat.nr_tried++; s->stat.sz_tried += sz_tried; if (sz_applied) s->stat.nr_applied++; s->stat.sz_applied += sz_applied; + s->stat.sz_ops_filter_passed += sz_ops_filter_passed; } static bool __damos_filter_out(struct damon_ctx *ctx, struct damon_target *t, @@ -1580,7 +1582,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, r->age = 0; update_stat: - damos_update_stat(s, sz, sz_applied); + damos_update_stat(s, sz, sz_applied, sz_ops_filter_passed); } static void damon_do_apply_schemes(struct damon_ctx *c, From patchwork Thu Dec 19 04:03:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914450 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 92AAEE77184 for ; Thu, 19 Dec 2024 04:04:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B2766B0099; Wed, 18 Dec 2024 23:03:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C4E96B009A; Wed, 18 Dec 2024 23:03:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8A956B009B; Wed, 18 Dec 2024 23:03:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C70576B0099 for ; Wed, 18 Dec 2024 23:03:51 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7AF7BC13C6 for ; Thu, 19 Dec 2024 04:03:51 +0000 (UTC) X-FDA: 82910363760.06.D50100F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf01.hostedemail.com (Postfix) with ESMTP id 28C7340016 for ; Thu, 19 Dec 2024 04:03:25 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AKbtPxMH; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581014; a=rsa-sha256; cv=none; b=ENRtTi7oP4A8N2MkvT0OS8sX6oskoj8BCHpzrmLPx1E5lERQ6v+aTbePe1INIepmIBSWXt 96Oajnu9aJHhi5CiU15ThVNmHRe6sSktG53sBV5cvlsLcKoItT5DEvRhREQMNK1ugrxFaf TGo3AbfS0okRmcJb45k8bTiCK418zqM= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AKbtPxMH; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581014; 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=wKALUXA5KOlaxQuesRY7XJJ0y9IguV010vsxGpJLWbY=; b=nxDTXNV7CW7MHLxwwQIIuI/2aGZX/T56FQAdJNTiwLCt2kTOZPTKY/pS7qqbqDBN59JdoG IRmWboq56SBh/p9PCQPRUvm7Hxmg6wQi27P6GvGv1DPFC+utTnRAkBlSZGmmbUvmAsMfTH 4j8vJstgIeyFwBfYEMr6S0sPEV8cmxA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id D66E5A41BFF; Thu, 19 Dec 2024 04:01:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCD8FC4CEDF; Thu, 19 Dec 2024 04:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581029; bh=ftF2xdlxRC1hxynZygPWzsGSDwQOUYQsL2NA51xCWlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AKbtPxMHjXd7OQ5NwLrw2rb6mfgfVvKC+Xdq9KN6MwWXV9XNXYG4JzMifPgH+ga/s Vwr8ZzhYg18JFB/OYTJP+eOGnvUF9fSjiXvYRxbBsRiC1QEUjiREfqmzGlKo2lk87l qEcOWHjI00o3g80l/lUYFmovE1es9Vt9QIcwW452AR+Wmy52mDaiEGrHflcwcVmHJ6 gF5ob4nECqNkAzPa7j3GmYiVmyb+nb7R1xmJ9IPL3dpdzWyPqJhGrkXPIzmK7JtiDg cKuHyBjb+4x3visLeMmz7Sv6wUhjFtO0Bv/IXPOA5CSk+G6lNHGNanfA1idK/atgZc nrrnve8rqAACg== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 09/18] mm/damon/syfs-schemes: implement per-scheme filter-passed bytes stat Date: Wed, 18 Dec 2024 20:03:18 -0800 Message-Id: <20241219040327.61902-10-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 28C7340016 X-Stat-Signature: jrfxewc5uzgwfmhuj4kwqbwi5q7gc8sr X-HE-Tag: 1734581005-53992 X-HE-Meta: U2FsdGVkX1//Y/9LB5giWlJ6RwoL3zfrhAep6Fw/tPQeaOmbUklpOHbhNNB6Nd2TfcDxT9RyotthLoL9iP4+ttxTS7gNV+lNBYpIa1lO5nLo5bAAkvX5qfDtSZCEHxUU1CCvUCC1OxM27jiFTp7zGwronBS/MntElk/izU1qnLOqwMbkGnNjWPVDN2qSiMjt2zXGCCYk8ol6+eAbSSjUJ4kQy0DH24AU/jvVsqvIkbeX50tkOtZVWQkj8btspvxB3q9H2GQODQ8hryGjwQuHOmZyB2uv6wUUZp2wy+cehtQFQZ8ydgvOTSIGUgJZvWq+9elVA6VQHV2PXA7DNWqXT6/eWI8Wq38w24gJybQcUq2vaFqzs0dNqwvdsbwS8lqDtci/2rOt6EnLOlwZn2P9M1UsaEP9bnkr3tvF6b7p2Mn5dq7GB6kEpwBmskkxdADELfcyerxxwFRiu/dvkG497C5lbWd8MFrcUIjzWxo8tjZsJnhtnSlHHS1K51fMhF4zDf/NHiL6cc9MRmISEDFljOzaGsJZpaC2ZqZ+h1BQHt3WWuMMXEV3AFo2F8FFj8pxd24KQrlFIczRHZ/Te+Kt0rZJuR1/26EKKz5QPke+haGYMH4nUBsrypVnxQekGHDFf7TQZsc34tk73IOht0lZWqpviiq3ulxbAuFzY0y4p1hGrk/hvoyV1Nic3l36jr14OY7CMTBn4mXIKs+9lMfMSAKS5GHbEwWbnc2uKpRn7ekrCGcyNpqSQER5QQkCJyLN7xyc8kEXaNjUnn2lf4o3VmTKvNjeJt6dKfyUM7k5DSOP491W2rGr7nKiqq0GTjnSJdo/9pdC9OUVayHV0vbOTwgPlenso5ObYvVYx2A9FLcnpVwAvcz+xS9ArueyBFAusyDUBlAHkxdwvQMfVGwLfbJ6q4im1H0N2mOy1sqawpaoHfBeg6JFyoxdApvLeKGfpOiXl7m4tA4Z/GcuW6p 6ZLXq7Iq BsdszGbh8PgPIRm0d5tQ682eTrHdzj/TCElACuHsfhgXpfCo5eIg8LStYQy91Ciw3sU1fhkfBEkQpRKpjdCg44wc67N32/T0MyTawQXijvDY7lVrxzfFMPmEZAd30TdY+OLXH9nX4HHNfdhZ8Ab5IDBmWsS0EIiLf4tBxk3pDWK1iqirLXX3LNqX094e1l9Jb2G9oBhr5BKkvVhehiBsZnHOdUCM5br+i5iPxISjw9+5o3e0= 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: Add a new DAMON sysfs interface file under scheme stat directory, namely 'sz_ops_filter_passed'. It represents total bytes that passed region-internal DAMOS filters of the scheme that handled by the DAMON operations set layer. Signed-off-by: SeongJae Park --- mm/damon/sysfs-schemes.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 5c4490b97258..b447c412b02c 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -188,6 +188,7 @@ struct damon_sysfs_stats { unsigned long sz_tried; unsigned long nr_applied; unsigned long sz_applied; + unsigned long sz_ops_filter_passed; unsigned long qt_exceeds; }; @@ -232,6 +233,15 @@ static ssize_t sz_applied_show(struct kobject *kobj, return sysfs_emit(buf, "%lu\n", stats->sz_applied); } +static ssize_t sz_ops_filter_passed_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_stats *stats = container_of(kobj, + struct damon_sysfs_stats, kobj); + + return sysfs_emit(buf, "%lu\n", stats->sz_ops_filter_passed); +} + static ssize_t qt_exceeds_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -258,6 +268,9 @@ static struct kobj_attribute damon_sysfs_stats_nr_applied_attr = static struct kobj_attribute damon_sysfs_stats_sz_applied_attr = __ATTR_RO_MODE(sz_applied, 0400); +static struct kobj_attribute damon_sysfs_stats_sz_ops_filter_passed_attr = + __ATTR_RO_MODE(sz_ops_filter_passed, 0400); + static struct kobj_attribute damon_sysfs_stats_qt_exceeds_attr = __ATTR_RO_MODE(qt_exceeds, 0400); @@ -266,6 +279,7 @@ static struct attribute *damon_sysfs_stats_attrs[] = { &damon_sysfs_stats_sz_tried_attr.attr, &damon_sysfs_stats_nr_applied_attr.attr, &damon_sysfs_stats_sz_applied_attr.attr, + &damon_sysfs_stats_sz_ops_filter_passed_attr.attr, &damon_sysfs_stats_qt_exceeds_attr.attr, NULL, }; @@ -2077,6 +2091,8 @@ void damon_sysfs_schemes_update_stats( sysfs_stats->sz_tried = scheme->stat.sz_tried; sysfs_stats->nr_applied = scheme->stat.nr_applied; sysfs_stats->sz_applied = scheme->stat.sz_applied; + sysfs_stats->sz_ops_filter_passed = + scheme->stat.sz_ops_filter_passed; sysfs_stats->qt_exceeds = scheme->stat.qt_exceeds; } } From patchwork Thu Dec 19 04:03:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914451 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 1CA68E7718A for ; Thu, 19 Dec 2024 04:04:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61E906B009B; Wed, 18 Dec 2024 23:03:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 57E206B009C; Wed, 18 Dec 2024 23:03:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FD016B009D; Wed, 18 Dec 2024 23:03:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 17C2D6B009B for ; Wed, 18 Dec 2024 23:03:53 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 955A6A13C3 for ; Thu, 19 Dec 2024 04:03:52 +0000 (UTC) X-FDA: 82910363844.25.2D19328 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf15.hostedemail.com (Postfix) with ESMTP id 7D5ECA0007 for ; Thu, 19 Dec 2024 04:03:02 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CYwAX7Xr; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1734581008; 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=nPkGviX7rzW7q6Bg8iEAiQK/d5950CvX/MNboY/0qAU=; b=UUViGZqPL6WFEnNmKV/xtt2ugrysyztURyl5Kx35OF4oA5aXaXisefl0ZDGCMK7zizbYUq a/Og7YUkpPn0maMwwCuRg9wcZrJnG0qBf/z3JpQyTTFYGFNQYGynMX72T1PKfmf41sBZPH tNC+ExkQJwI3o5EQD65dBjFRX21arMc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CYwAX7Xr; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581008; a=rsa-sha256; cv=none; b=TmcY8f3ohmOPEf+CWHF0tlrGyz+l6eaAlH7/hzXeCI6PQA23Y9P6fGyjuvSOOBYIbc1QuO LaYMr5EGUZe35XXmbn7SP1Emm4kJ+zm41WQJpCLHKj5DttFuA/qQPufVapXPgiHtI1ncaV Ql8POCy7DQ28tJ1XbYwZW66oB/Kvr+s= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id D605FA41BE4; Thu, 19 Dec 2024 04:01:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDD6CC4CED4; Thu, 19 Dec 2024 04:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581030; bh=NyHDQet0LRs2AoDvHZh43WUs/U9z0r8H5Ts9BS0wdXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CYwAX7XrgZWFXmgmYy9RrbgMbpulDtXMa+kPOwJ3WYCEdKsREfTaO3PA3QNyjZLNL 4ljRYx1V8TP0l87I3/C6lTns2NsF4SroAfF1ZDghJLjJT7M/Wr1qs6fQpouwrDsH7i 3y6UtNk1IcZqc4RZh2H2QNbXXeuvV65MFz5Mx6bgaQhR3dkgNCcFd0GK/pN9XIq7Kb FYU+VpgzN5ZImbV49cPC/n1UUW5C9e/26hjrvMam32dMsJFP80tNuYfnZi9UO2i9Nd EB5qVlkBmK/Xo4f6TS3No1FiO7wrCJxkrKtyxE/v8ERGdhIiXzS77+wEdPXKawjFZs GW5vGIbI3MovQ== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 10/18] Docs/mm/damon/design: document sz_ops_filter_passed Date: Wed, 18 Dec 2024 20:03:19 -0800 Message-Id: <20241219040327.61902-11-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: fgcxzifyfdc89teddobsf7cwy5j18pek X-Rspamd-Queue-Id: 7D5ECA0007 X-Rspam-User: X-HE-Tag: 1734580982-544551 X-HE-Meta: U2FsdGVkX19eKdjZNyC1Gi2F2rqUl3uxWcUGBkPy02CJ+wdWZdma7hMJhQT06edNo36xeaoTWPLh2cWWs2ICodX7AEw6Cs/7ce1iUQ0kG5Ssewnh7otIrxjJ3t5e/+k8a/NbbMDAB0RGpQiRyNR8txctimQ9vjhVwEerx/kkAyvNi1A8ummhSFyiP377hhms4UHHqdB4T/M/0GOPGxHExBqmY1W/1EvZuSXCqelDSsrqYliDYqoKDTHtag+E+BODZSg2o6AyawecLu0n6OziM5PIndGEBDouo93hzNjaKLkS658vK559+H2tv+G/v1KgRu1+Scr7cAh36erUi75OLY+Aar/19M050r0uyg1FZUgpi6v70astD6XZUzqModnrNS3U1iKixvEWUbvmxeXRHLApnbAR5W1uNZ/5ZsomPb33womAelrD5iMPeOcWc/SzoHGKGYiVIOQilfPGrojXsenJ6oICcEiU1izuszS+ArQXFB4gUd0aw+UsD16xBTizPMZAzF7INkFpMqf9cgEdiq6wTK01V4aZnYQtdVB6mvmjxefr6s8eX3CWxd4YafTHH88P32bXDAYLF6ooiJSwALFaoFy/X7hcA3mqWLoSRfn4cChOc2Wra/qv4CjarxQrmX0O5hXQ4SoYJmCuVOmRxYht8QVCZl6T9cprO7giEuugaA3OwGkRc7A2Tn8FN8UGK8uxUyZAZ15PXRgPVoMGPa3bEU3r287CQxG6ogM2FCyFvmbXcn+u7+ELTzJVT2EYxF0MUPQYeC6jaEXChZo/nIzlgU9UjBu9fMUapwEPYgULIySEESoj+pCJDyAONWvf0MBCWsC0l8XlApVv2pwYy1Gwwf4fB6wwwERmuSriloNI4ui5YAJWUhwoDt/N2vco2DrnNXGxLvRrYAVGrKcsinTMHbpu72heqdr9IsVvdPcDAEHiYUawA+dUcSbiAE7zphHtl3+4e7q1/LxHrId JBCmay8/ CKBMBNagJeGkWgUV4+BlFKRA0nMKhflJ2QxlhWYkQsbljxkXKTtquzw1RrSpoGWrIGuK1nNBWMqUF1fUwTTP5tpeA017qGeZbzNl9hTVB4nTA/PmhuFbd8cbhQHfO3Dg1KboQ0fwo1+kUhWLQ7WCarwmovr8QH0ULJiYf/5jVN6Ujf41uqsSVqOm+pbnWMQNsJsOS72hC8bja172946ZOiTTwI9XrxPplpK9/LqeVXLshXAQlngfMgHwSbjiUT64j2hvSF1TftH/NYSZUF4fWiCrK8w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001625, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Document the new per-scheme accumulated stat for total bytes that passed the operations set layer-handled DAMOS filters on the design document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index e2666124e382..0620675a1e8d 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -552,6 +552,8 @@ scheme's execution. - ``nr_tried``: Total number of regions that the scheme is tried to be applied. - ``sz_trtied``: Total size of regions that the scheme is tried to be applied. +- ``sz_ops_filter_passed``: Total bytes that passed operations set + layer-handled DAMOS filters. - ``nr_applied``: Total number of regions that the scheme is applied. - ``sz_applied``: Total size of regions that the scheme is applied. - ``qt_exceeds``: Total number of times the quota of the scheme has exceeded. From patchwork Thu Dec 19 04:03:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914452 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 AF488E7718A for ; Thu, 19 Dec 2024 04:04:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4BCCC6B009C; Wed, 18 Dec 2024 23:03:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 46C846B009D; Wed, 18 Dec 2024 23:03:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E7DF6B009E; Wed, 18 Dec 2024 23:03:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 14AEF6B009C for ; Wed, 18 Dec 2024 23:03:54 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C6B0516134C for ; Thu, 19 Dec 2024 04:03:53 +0000 (UTC) X-FDA: 82910364516.11.F12E0D9 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf24.hostedemail.com (Postfix) with ESMTP id D9CAE180010 for ; Thu, 19 Dec 2024 04:03:47 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CKqclcbh; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581001; a=rsa-sha256; cv=none; b=N4zEk2zT3s9neZj7jzcvllxBebIm1tMk7g2y/SD6GM80u8Uv0kICYnZXH8lcTlKtPYJUvL 5V5FpOpxowLYHcSC04DA4YWtAQgKmuHxspsRnk/DCkKEizDS3rTfTKmndHEvAAooxfYuMs bt3Xki4usbtUS4vPzZg1NSjMIb0KF04= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CKqclcbh; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581001; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=O39CKp9QO8JPIGatylosE2HMFuIWlELJlkFwGQH7FAk=; b=VUTXoxNxsiSyTZamcc7Zp5Yu8J5u103PTyzKkVfiHgqs4IVnJjAMsCSojRymcEyJSoCcMI K2/1B9Mk0xGMRhz/nFMmph6EX7Xa4qqFB5Wh/lVS5UCswxzPCNWNClynrSEGaR5vej1TmY Z9vEsuE8oUkOE5uZlVHw0s5tKtNmTqQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 0D780A41BED; Thu, 19 Dec 2024 04:02:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23831C4CED4; Thu, 19 Dec 2024 04:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581031; bh=E3nDxsQnOnucfR2JdCI6gXATVIHYtLFHhB+wDRP7hiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CKqclcbhPJF7kqBVAm02cPqjr4b/PMnD/U8sX8WuWogMdXCphEjY/C16CebDzcjru kTMexC+Xk4wt4g4iCGSKjnD55BuWbTx2Srh895iCRkEtu8KwyGlZotxN/aa5YN52Jx PX1fSqlm9ch6RFmtWBib6ULcj1XvHxKpDc4imqoayb6+7fU+BNTerh+BeKcrkSc3oS 0X/qiya1fv4+jeRZ+xaBZbU4RJUVESPorK2aQqCBtWrXEcN1mBt1EdhELOWm7u7HRe 1oRi48nnWsbLVPsW9HbOVy1++GfiNi9zI8yeZjsreEAAI+r9Cozk63ZF6XmQ/tKO2E JA5HzqucfzhJg== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 11/18] Docs/admin-guide/mm/damon/usage: document sz_ops_filter_passed Date: Wed, 18 Dec 2024 20:03:20 -0800 Message-Id: <20241219040327.61902-12-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D9CAE180010 X-Stat-Signature: aaubsrzp8qstg8cztj71pcyysh7ktxgr X-Rspam-User: X-HE-Tag: 1734581027-432424 X-HE-Meta: U2FsdGVkX1//eNAH6x+/4BjroxuiySGr/WXk4uNmGLLyUyYecMxxQv1VH3NNaJVTx43AbroMjWBQAsTf1z8dcsmv7J5xPhrea2Q95b8kVEUSPo8tOtXglPaEmLt+85Z6EpvnT8uCP2N7INC+Y01qDEZqpd/X4npRTp34Vdlvz93BIbnwhDDK11DQ7lUdWym0+sjgTaY0Z39piwFfDTWiY/uAprFMbyiQzwX2aHcxl9WT+RicS6MBrXxN1akK1qBuRzRoMuSCZIxvF1LXDDPWMke7GK2zQQy5h6qa/N4NE64lWSHgHh0CNpqNLnGBVdic9DgtjtCpyot79m1UZSk8qcchjPkhETh4ZP530IRQ1/cIO6s6w1O1urJ4v9Kc8Cbl1u+TYa6hcttFmgE+Ai3mkIO6kvRZ+Y/4x7/WIuz+Xo2+um0W+7Ws/21simgWMKySPP/5fUtuujVtCn6zqlXfKm8QddBBXUbr/17IXBClfdjO5uHdAIQPvy4g4dkwlkJUsdW5/OlINtaITcMjtISc/70t5cvnEa8N+JhKVBGyII0FqUHDkQaF5H/wTNjpUH2wEjkJStt0KL5wyOsrev7SphZm1nbJ/ypij0sZ57KEO1MOkZsL4AunjF9Erh0sXzq+rMWWC/tSur1om09mTXdBkH4lt39AJQ2Jd+5Eq9KF6xjkQTRCY28clRy3541dwmlBixNJOkfURiyVV41ib00FV0x2o0gAMi0krX3JdZ6ZMgCx65wNoKsAd+QE9dZ8IEwOeiRPnYtgcnPh1CCor7Tn4tLK5ZDa15NmGqXUA+QE50UbM3PeuBm6upg6ZlHMOK1cvSYlSHm8cfD7zIFaA6WfUE3s+5zk3RvwHRcdQAKD+RcP2CInrHxdWESwflQxrGJCEEvRow1S1/iXu1PX5LzRDPyEtLbqE9ht57b5usxWzL5i4uhEwI2DmktBzv8Q6jBdTRa7/hlCDUZe2jvhEqT chXqPmqX 5nvG10zyHCe5ebxyFdr9PEPhsVKDuDRBHeDYD3EbJLZYYiFvPCPVRHFhhGqE0NhWlBGkQZ4RMT0pE0oC6ZCln4qzkU/TAZzLHHy5/Zga+u7qvjff7vPJJX2tt5W5QLl1Zci86uvs5XZafageqr28dfb8Ave7w+gk2+YLPlJHebe2ijrZMm9PUtOselBK5gzT2mLb0l7G7bljuXVg2rkHOyvhwMu8A93+NRqJ+EURCK4vD+SoDmcl0zuTIAWggaqW8jMVTX/nGPPKgBCvkglxj0I6R0KnRT6OtJL2kTXlWgomRlNRHG9yIuh/7ymIzFSU2U/do+PjV8QHBO3wRIXtKlDkpmJHBEQp8MKs/ 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: Document the new per-scheme operations set layer-handled DAMOS filters passed bytes statistic file on DAMON sysfs interface usage document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index af70f7244700..179a9060a32e 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -90,7 +90,7 @@ comma (","). │ │ │ │ │ │ │ :ref:`watermarks `/metric,interval_us,high,mid,low │ │ │ │ │ │ │ :ref:`filters `/nr_filters │ │ │ │ │ │ │ │ 0/type,matching,memcg_id - │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds + │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age │ │ │ │ │ │ │ │ ... @@ -454,18 +454,16 @@ difference is applied to :ref:`stats ` and schemes//stats/ ------------------ -DAMON counts the total number and bytes of regions that each scheme is tried to -be applied, the two numbers for the regions that each scheme is successfully -applied, and the total number of the quota limit exceeds. This statistics can -be used for online analysis or tuning of the schemes. Refer to :ref:`design -doc ` for more details about the stats. +DAMON counts statistics for each scheme. This statistics can be used for +online analysis or tuning of the schemes. Refer to :ref:`design doc +` for more details about the stats. The statistics can be retrieved by reading the files under ``stats`` directory -(``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``, and -``qt_exceeds``), respectively. The files are not updated in real time, so you -should ask DAMON sysfs interface to update the content of the files for the -stats by writing a special keyword, ``update_schemes_stats`` to the relevant -``kdamonds//state`` file. +(``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``, +``sz_ops_filter_passed``, and ``qt_exceeds``), respectively. The files are not +updated in real time, so you should ask DAMON sysfs interface to update the +content of the files for the stats by writing a special keyword, +``update_schemes_stats`` to the relevant ``kdamonds//state`` file. .. _sysfs_schemes_tried_regions: From patchwork Thu Dec 19 04:03:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914453 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 6C345E77184 for ; Thu, 19 Dec 2024 04:04:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8401D6B009E; Wed, 18 Dec 2024 23:03:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CB3B6B009F; Wed, 18 Dec 2024 23:03:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 691146B00A0; Wed, 18 Dec 2024 23:03:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 424B86B009E for ; Wed, 18 Dec 2024 23:03:55 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F1383AFFCB for ; Thu, 19 Dec 2024 04:03:54 +0000 (UTC) X-FDA: 82910363634.03.24BEE05 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 2A4A8100017 for ; Thu, 19 Dec 2024 04:02:51 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Okgt+R3n; spf=pass (imf05.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=1734581018; 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=fp/M5qtlpa5xEAVPBJdPeMW9+kyBozw/GmAvcT1Vf1I=; b=cwhZxW0OvJoCoAOg0bLIjk1AqsM//GqCjxbYA2GELP94+vHfFqYd32MhwHdH3OTJLSu+Ml +ee2VL0m9xWDxm5ie2X7TKzvj2ege8LmQI+6tCgM6aNtsJiy1qvlIeGMUwFEcy+PtwmTHD Urtkx86tBdYLzppMDsYBurJopASd32c= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Okgt+R3n; spf=pass (imf05.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581018; a=rsa-sha256; cv=none; b=dAvMCMhmEGiNzNLx7+JDlYNPoVYok/Ho7GS+2wB+UQgcYcaT/jAevEjomvIS/KRJ1psEF9 /KG5bMAU+fRrUYB0/x7G0k5QKMZ7aWrHYEkuZXOSJutFF/FC6O6rb9twr6JkkC80f3Avk7 hmsE9LAMz23AACh09Wm2peiKUGmtgCw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BB7995C65D0; Thu, 19 Dec 2024 04:03:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56C24C4CED6; Thu, 19 Dec 2024 04:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581032; bh=SpnwWXRTfkYMqczlFfBjIRSLjyD9BiybsCKabnuSowk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Okgt+R3nL+tMQulyJrSFoz4uD0MSWUhjapO1ixK/kNHeGI2yuwlPCkNTLEo0J6xzr YxT/RrmMFkYzuBSFDLBolZyT4c1UO+XymRSnqfL9EVyS2ugao/7bGvyOvrbCk8NSEK yRI1fYsCNQEFoCFSgUgTd2G00TAzdormCy0hthYnK6m6j50ZuTSVA8D8hYvNOgb8wA jtj/FzeYaetD5WMO9L31/PGO+TMG92PQwMiOYO/xsfSV/v/rktLO8brrKv2ENbj/Ar tIfN7M/TT8HxKjVHNXue3OMu/D5t318yDDFTQI+lWJFou1a+Hcz1/Qc4TSwbPkKQWm RCw+aFdXqkmPQ== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 12/18] Docs/ABI/damon: document per-scheme filter-passed bytes stat file Date: Wed, 18 Dec 2024 20:03:21 -0800 Message-Id: <20241219040327.61902-13-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2A4A8100017 X-Stat-Signature: kx38abks53w4p3auepeu94faddhutjmz X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734580971-196583 X-HE-Meta: U2FsdGVkX1+DEpJe/NmK4LqHGOthwloOz1yqrb8VrXYr34Y6ZwGX59yG9ic2oXJcFa8uVSR3KbqlaafihckIVe2F1yaiWqYAa3JxDCxKPWDB2m7H1xnpQi06kcsc6qJGHtjhGHHbIN/QbFP3ZwsUZ7baQZcdt9f7rBL7MK2FWdwLHbAKhD42Kzjbqbc/lXY9M5FTvTYWVVMOGuKKV6l/zjcB1Y8K7xHwSWotjIqBm/QwjHkFQckN+BjbiCz4d+hadCRJ5rh6vmJRILaTRhDNbJPA4Mt4YfA4LfuysIfWwF3aEfvdeUpJ3rFpHQXMXg/1h/J1plVd8sTEpteem2XCd58ug5w4QpNkdbmODYwZaih9MFmIAuwyjwpERgDNX2FS0M4BpdEfSlzhHuhJdRcKuV7cWsXsHQCPQNsZ+ODAULktPeuuj3PmbIKatN0DQItwodoOVDejr+FfDnxwmDGPsBPWNf3DHqtxxmqmpallmx+1MZWB0GkP/fvv/yu9VMyftEXeHVCVsmOLNuXZgsdNeTjudh+gMJPbFQ4VrOSbtbt2BjaelHMPNl7tsqpvkcpbubDyPd9BSu4l3SnM+D/qGm9OjfmCskz8Ulqdsr6BtMPooDVwo+Ws92xdFrVt0FhOW9eZH5sBoKIrmYA7cBD29MQqQuovYl08asWP9hfwFxDR4j4OIAE1RdfvODLxujTLKJTlXmekH9Gc1LyY13DuGmNbYmeON//xK8lL5as0D3HXnRPUjyFPYfWV0v/P+Lm1V4ddeXyOsABKXY5YBBvi/Ds/33CAYNwOSo6mPHzTwvHTiyDNYFxMpBhkOs7v5jIxk6FsWq6WxPXjtgpT0mjTow+smuwg0yj+bLzJbA9T7jl/Zn8SARObyMK5e2qyM229CfztKY5S1ILEXgi3lOP69MWnL7I6bVCUgWj/hjI9EKi93zUSZpYXXYr8S8bBga+yHBMdNIfJJYH1ZVGDCyq aNDxiwL6 dmhwqZHhwQy5iiPMpQnFI9AmSHnhpA7y3K4zJMzW1SSa6mvyPfFKpaCR4VQL6O297suCDlRcd2/9K32XAzEENpGofVnrVJb+B4vhG1RTZp1odj3Ha0V7jtRjskLwEHZu0bI45VwJRmI6PXCMV/WfaMeFZuFSpoHUpHEnxJgqwi5w6wwAtk/eT5wkQKynRL47EvLac+UsMJ0Dav1elRRtaCntM+xMDxOkVt/INHIKJsW0rGGcoT3wd+H98JiRRDHInRaKzNzAQ815snDI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Document the new ABI for per-scheme operations set layer-handled DAMOS filters passed bytes statistic on the ABI document. Signed-off-by: SeongJae Park --- Documentation/ABI/testing/sysfs-kernel-mm-damon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-damon b/Documentation/ABI/testing/sysfs-kernel-mm-damon index f1b90cf1249b..19cde386fd15 100644 --- a/Documentation/ABI/testing/sysfs-kernel-mm-damon +++ b/Documentation/ABI/testing/sysfs-kernel-mm-damon @@ -384,6 +384,12 @@ Contact: SeongJae Park Description: Reading this file returns the total size of regions that the action of the scheme has successfully applied in bytes. +What: /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes//stats/sz_ops_filter_passed +Date: Dec 2024 +Contact: SeongJae Park +Description: Reading this file returns the total size of memory that passed + DAMON operations layer-handled filters of the scheme in bytes. + What: /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes//stats/qt_exceeds Date: Mar 2022 Contact: SeongJae Park From patchwork Thu Dec 19 04:03: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: 13914454 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 5283AE77184 for ; Thu, 19 Dec 2024 04:04:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB2816B009F; Wed, 18 Dec 2024 23:03:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ECE06B00A0; Wed, 18 Dec 2024 23:03:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C9D36B00A1; Wed, 18 Dec 2024 23:03:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5C1ED6B009F for ; Wed, 18 Dec 2024 23:03:56 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 12B801A13C7 for ; Thu, 19 Dec 2024 04:03:56 +0000 (UTC) X-FDA: 82910364600.16.12F439F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf03.hostedemail.com (Postfix) with ESMTP id B3D9E20007 for ; Thu, 19 Dec 2024 04:03:39 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="WlLm/A9A"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581019; 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=VJk+ZG/yL76bJ3tbrd4lU6dnkauHM4vPOx1Joc85aGc=; b=ZlXEk0kM/oYkBr/zVMIY6IaCcwGr5VB4K9ZihzsZzAhzaA/qUidqArIUNhdpiponqaQ9Pr TJkjj+K4AnZfl+NQeT+TRA1R40eKcwT9/UR+3ETapV9ucj82CV2ZyAUSsoSx53cr/73mbj RJx0uNRJyEnqs8+sbzB/8paQykiPTjY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581019; a=rsa-sha256; cv=none; b=e8WGd/OiUJIa72PgQHkc02qYtZbn9TprNWyPcIJVQAwqxYIbgt8kW4PM57HlSeyGH+SWjN kkNOPdc9hhNcOQT6TFaHYPhHV3rIeNzweXeugA0mWKGftguJzEjjhHXbZs2ClDkBHSu4UI uW9AWsRBH0OEmqOGa54EbJVToDpNLa8= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="WlLm/A9A"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5E4DBA41BE4; Thu, 19 Dec 2024 04:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CDBAC4CED4; Thu, 19 Dec 2024 04:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581033; bh=uqG8Q9Szz47DcZj8JtbgYt8Z9acAYgWsyXGkRRs6FvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WlLm/A9Al/6Pem+PtlX0UaTXy+7/tQBEeZTMaw6V2dKYfBiM/eFoArYBajWW48+yG OJuFLmwzHsPUEJ9t1o/xV/YzDH9DUoI2zydoHko9m7055yQfxEGs1LlR5irSd/Fx7f DyYVnt4m5Gcr2Bx8EtjWN0rdpxZt72sCi9OokPAhZ3ghi1FydpigdWWAtxImV0fJ3J 7fSbm9fyit4hYVtVxlkJcwQKFeHVZYh749/+NXYeXX0nBPfZyzrpVd1itd0ZV8vLpK lO53kuJDNrWkh/j8WoY6LpOaSVoUfvenrhx/c0wHj7Tsb44fdIfxoyNSFf4bEHaOA2 kcVb0j5A+7jJw== From: SeongJae Park To: SeongJae Park Cc: kernel-team@meta.com, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 13/18] mm/damon/core: invoke damos_walk_control->walk_fn() after applying action Date: Wed, 18 Dec 2024 20:03:22 -0800 Message-Id: <20241219040327.61902-14-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: nizqzgqwd488szhthoe7zruan9i8bzzn X-Rspamd-Queue-Id: B3D9E20007 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1734581019-226213 X-HE-Meta: U2FsdGVkX19F/W8AUkSt7DwaBhR6XmUQptzHq+wdOfzhWWCjffmP8+NcBlGsboja16BYeJizyqloHpNBC8RJTuNFK0wHLeddL5x1E80R3IGRxkAuc8KYB11Vp7xwW1av1KLt92g3kp+F+MShlyyUlMQstl/igm6XHut2X5rPlQHbfvp1NIa8jGKBmEaw+tCXn9gABchV5nSSQrSL/BOGhgSxfgmRstYgri5Z7WrhKQ9VUX/5MwXfjD9/R3K+J1JgtRrlPItpBnNZCvH97+dwpoe7n/nr4P/P6Xpp+N7n3r6h08ERbr4F8ZhmoXGEiBqoat9CT0oYkNfNMbRgpyOfs1Otkcw2ygeEmZn0Tt+Byzn2etLBGkIO4QtOsjk7HNx48Vwfd5fmgJL+r05CrAGZWMxfJlfXZTJfIXNtAaWdEoYSEi4thg02ZTC8jFPLVS9+ITH32CE1Ga36zumKf39nAP3UDZlNuCHGPiknKIiK68xdaNoXbBseBTB9GzhJsrF3VqQuabIr6zoR2/EwCOD8E9LW7m/5rGFBaktOgRcMmKZKtKAkprqKo2y34Zt2XHshvU3yLiKinfLdPABw2Qjs4YLFZHcvuCtIE7/dHhHYMRmcVmf4Qc8IxP5idYP2e4tuZafgJ+tnxfvfeMhfzwhFSjHBWC+97M3Wd9RwAGZIWXofRZYn0zcbHCPCZpc1fWxqeHeJidUNXIGZIexC2RARMkibFyxantVsn0yGZzXTIt2yX9ZAKktr12Exgu83rhip4W+S2PlN9Tqc6XIOY04+u0sCLzVFFHsr7oxvZvFtEWlHU9tnJOu6wbtamSvBSAtFvQPNdy3t0LCGWhcPGhBHcGtwsfT3TCZO+2HvCpPuhzTZue1/+4KL50oPPoKim4W0UQTG9kP49hVULVPwNANLhS/DbogQxu7F5+2aOF2iKWkSHpofx3gbisCbiy8kGOcm+gVSnJ2mHvZxU2nU7fC xQ02FQLz y527Z3z+sfgTCT+gsbIYyBFctWJsKo1tbKrr1LcIixjcDm35FNpMjVielbS3V+68UzWNdJ8YEoEbHVi/Ma9bnZ/0RHB+tA2mJwkq5nafOnI1xSPPDwaOQ+j00RMnVSbeZFZ7h8inu/1O8DjSavSyVIDOE772FZCsjsMTRKvvfl4cOnNkyPKAIzEcEVUpwznyosB2pO/6DEd3d382KF8lXihomMdeJCXeyVyJvxdmTIgv8gYFBs6TZoGfvF1aANLF3r0Ej2SVUkzJD5AFg41ns39j4IQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: damos_walk_control->walk_fn() is called just before a DAMOS action is applied to a region. It can be useful if some users want to make some changes to the region before the scheme's action is applied, but there is no such real usages. On the other hand, calling it after the DAMOS action is applied can give a chance to investigate what happened during applying the action to the region. Actually, followup commits will make and pass such information to walk_fn(). Invoke walk_fn() after applying the action. Signed-off-by: SeongJae Park --- mm/damon/core.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 8540e8f91260..f7736df4f6c8 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1214,7 +1214,7 @@ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control) * finishes handling of the request. * * The kdamond executes the given function in the main loop, for each region - * just before it applies any DAMOS actions of @ctx to it. The invocation is + * just after it applied any DAMOS actions of @ctx to it. The invocation is * made only within one &damos->apply_interval_us since damos_walk() * invocation, for each scheme. The given callback function can hence safely * access the internal data of &struct damon_ctx and &struct damon_region that @@ -1432,11 +1432,9 @@ static bool damos_filter_out(struct damon_ctx *ctx, struct damon_target *t, * @r: The region of @t that @s will be applied. * @s: The scheme of @ctx that will be applied to @r. * - * This function is called from kdamond whenever it found a region that - * eligible to apply a DAMOS scheme's action. If a DAMOS walk request is - * installed by damos_walk() and its &damos_walk_control->walk_fn has not - * invoked for the region for the last &damos->apply_interval_us interval, - * invoke it. + * This function is called from kdamond whenever it asked the operation set to + * apply a DAMOS scheme action to a region. If a DAMOS walk request is + * installed by damos_walk() and not yet uninstalled, invoke it. */ static void damos_walk_call_walk(struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, struct damos *s) @@ -1457,8 +1455,8 @@ static void damos_walk_call_walk(struct damon_ctx *ctx, struct damon_target *t, * @s: A scheme of @ctx that all walks are now done. * * This function is called when kdamond finished applying the action of a DAMOS - * scheme to regions that eligible for the given &damos->apply_interval_us. If - * every scheme of @ctx including @s now finished walking for at least one + * scheme to all regions that eligible for the given &damos->apply_interval_us. + * If every scheme of @ctx including @s now finished walking for at least one * &damos->apply_interval_us, this function makrs the handling of the given * DAMOS walk request is done, so that damos_walk() can wake up and return. */ @@ -1560,7 +1558,6 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, if (damos_filter_out(c, t, r, s)) return; ktime_get_coarse_ts64(&begin); - damos_walk_call_walk(c, t, r, s); if (c->callback.before_damos_apply) err = c->callback.before_damos_apply(c, t, r, s); if (!err) { @@ -1569,6 +1566,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, sz_applied = c->ops.apply_scheme(c, t, r, s, &sz_ops_filter_passed); } + damos_walk_call_walk(c, t, r, s); ktime_get_coarse_ts64(&end); quota->total_charged_ns += timespec64_to_ns(&end) - timespec64_to_ns(&begin); From patchwork Thu Dec 19 04:03:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914455 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 EDB11E77184 for ; Thu, 19 Dec 2024 04:04:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB2106B00A0; Wed, 18 Dec 2024 23:03:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C5BA76B00A2; Wed, 18 Dec 2024 23:03:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B23EB6B00A3; Wed, 18 Dec 2024 23:03:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8CB706B00A0 for ; Wed, 18 Dec 2024 23:03:57 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 448811C7E33 for ; Thu, 19 Dec 2024 04:03:57 +0000 (UTC) X-FDA: 82910363802.08.537A353 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf08.hostedemail.com (Postfix) with ESMTP id 108E5160008 for ; Thu, 19 Dec 2024 04:03:33 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rzq44vv7; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1734581011; 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=vpg2w9OBJGFBhgZAOMPYZK3k1PQHa+4tX6YfWAsBwv0=; b=UShin/NWTFCPJdexZzRaYNJEcuwiVaa/ljI8aL6YdlU2+c3TJHZa4VdFQMBqxC7bzrCvxU GI2WKYuOjwM4xqLqMXvpzlRq++IUrDj9cc7CdznCqxXBcbuusBM8fam1EtR/P0MaqqdI7R 10743d7q3P/XffNUVtRNeNqGMvaKlBU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=rzq44vv7; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581011; a=rsa-sha256; cv=none; b=vR8zdRsekMgYF4/t1foWu0KG2lTHPqMekEv8zolXPjH8h0uvNsMK/eTOkWNMlh5i62cMnv CtoTReQnLehIkRAlTeTviB/W+eB/JlL7uRnHtaga7w25WYOOuCvWLndKOTFimZD3lO2cle gZYue3I7kMxZYfT6/avV2c1AhkSbA4c= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9AB3BA41BE5; Thu, 19 Dec 2024 04:02:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF8A2C4CEDE; Thu, 19 Dec 2024 04:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581034; bh=B/+pkZ34Zt3Ov15iD+IrfcocGY4pQLzf/O+oQbY1lSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rzq44vv7oD0N2wj95XS2ZTJ1sSLOaqBIUq36nn7pmxoSw5ZpgQ3g9DCAnXg0Anw8n bFIpSdP7Yv1yOzha/Bw5/GTL0aH+9FuEQETPdZSKYcXkSx1h6kbPkkW7alb6gbJfSh lfXrUimMecgBRoGXL66pD0XsJ7rhIasRwOt9nREX/c1KWizBC/YE4+yeambCjMRrqi 2ekvViNaTS5YuWgpQDNpxWjG0XZ0LiiNSELDOa1vjr5LiscPbC4DliiXVSmov/pX6q ou0yrGFJ+KLQ9Z9woz12s9t7dC0cCGxb2Pzh0a2YEXdJgzisKDiD2fEyjo0tM1gGOB jnrg4qfav135w== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 14/18] mm/damon/core: pass per-region filter-passed bytes to damos_walk_control->walk_fn() Date: Wed, 18 Dec 2024 20:03:23 -0800 Message-Id: <20241219040327.61902-15-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 108E5160008 X-Rspamd-Server: rspam12 X-Stat-Signature: gihr4gco4niq9moup84riic5ygfcpdhb X-Rspam-User: X-HE-Tag: 1734581013-521818 X-HE-Meta: U2FsdGVkX1+xNO1XG63Uqn228Y7MwV1B1i3WXvilp+/v8QJn6rAb9vdEpFzm54LbAV1EIpgiZ+ftAo9Mao3jqqNoKWIrnjeMNAZoZKdJdEPShJcIHoI0RaazMZ8Q1aFGkc2Tn9D8fkqHJ65C990GKv2rpncxuyAl31v3qse0c+snHUAwm0Vh/deBm3Yt1cPR85ajJUjE187n+yGxakRmmeUKLtYiG7CHFaKKoHsFJBRUMo2guHJZiMvL+g3H7RqiR7HD3h/ZjpRfwOk74kg3J+RU6BANz35txsUbfqASvK/X4U1GshyEU7r7T7ej58TCpkkWE0HrV3dUTiBMwVvOGazRG8AUp7lO1F0MBwT2YZbPrXW34bBDl2JMkO4+Y5eQaHnsLGQernkGJaJdiZzMmRdjYwQICZhdYVeKTIOxP+joVAQvSz1Dt7lovxWQ3fsKsgf5kocoGycBxdAl7liLrzzqqfwkp6uInAXzCAIdr05OJitOrB9fnzkWK5nWxt2jtyhGgBDpaTjQUXDfYgLYbQIERhiObKYqLinNCKCoxIUI4wiVr7waYSCCSxLT/CH7O4+Rj8ICDuHQbpo+v4RHKFCgNy2JM3TNdMpLb03D/jVcIcJr+cYxIG3swhMFQXzM9lJBbJH1yI1YukrlaOzGrogmcbVdzfQHE48gfWw6LLMzPXj7e619PLbNPdfpIZz4xr/G2cfb2ajpGY8qqb7LRbQ5llDdUCnjKAJF11BlS15xueAbDDnpXVyUjLi8Qy4mhgjtVrGbod68GyybD/MWuOr8hYFpOLBAk4XS8KFIg1YR/yqI2mQYKhAebkSY/ZOtT8v/c520LwyngT88fwyN+ZZXr3GrOHJM9eUqiN3m1LHYNl7y+3u1bBJiiASrznImOasZD516IXekRG9qdiNzCshRVpZKsHKCSAie7YYMdlBX8FTjS3AjmeL8hs6k6xAJ3nC/+47y/sC3W3djpta FjMJzIi9 WNIXsjWv2f41KFNog569h1TjlUyU39rKlBHo9ElW6DBNPlQEqiq6C4idooPSJsQS/Cfrb241EFOpmBsXYqYXHwRk9I1gTFiKp/3MlJ1jpNtZ84hvwNDXa3HdLP3sRDkiRlrfi8r5JDaG8GpruH5SdKnMXB7zCMeCeq6iD0BP1y0d/SYv3upItBYkmXJnne4ddlRpAWXwd4bibYAVOxagob6XOi7rUxShrZ3OxTNXP7aKjK/Gy1Kgu5oMnJaV49YIUXtKWgJcFCyLZuhYqt1YCPPsGIw== 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: Total size of memory that passed DAMON operations set layer-handled DAMOS filters per scheme is provided to DAMON core API and ABI (sysfs interface) users. It is useful, but that for each region can be more fine-grained information. Provide it to users of DAMON core API, specifically damos_walk() users, by passing the data to damos_walk_control->walk_fn(). Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 +- mm/damon/core.c | 7 ++++--- mm/damon/sysfs.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 4a68bb38aad5..b88f710297a9 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -393,7 +393,7 @@ struct damos; struct damos_walk_control { void (*walk_fn)(void *data, struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, - struct damos *s); + struct damos *s, unsigned long sz_filter_passed); void *data; /* private: internal use only */ /* informs if the kdamond finished handling of the walk request */ diff --git a/mm/damon/core.c b/mm/damon/core.c index f7736df4f6c8..f566cdcbb434 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1437,7 +1437,8 @@ static bool damos_filter_out(struct damon_ctx *ctx, struct damon_target *t, * installed by damos_walk() and not yet uninstalled, invoke it. */ static void damos_walk_call_walk(struct damon_ctx *ctx, struct damon_target *t, - struct damon_region *r, struct damos *s) + struct damon_region *r, struct damos *s, + unsigned long sz_filter_passed) { struct damos_walk_control *control; @@ -1446,7 +1447,7 @@ static void damos_walk_call_walk(struct damon_ctx *ctx, struct damon_target *t, mutex_unlock(&ctx->walk_control_lock); if (!control) return; - control->walk_fn(control->data, ctx, t, r, s); + control->walk_fn(control->data, ctx, t, r, s, sz_filter_passed); } /* @@ -1566,7 +1567,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, sz_applied = c->ops.apply_scheme(c, t, r, s, &sz_ops_filter_passed); } - damos_walk_call_walk(c, t, r, s); + damos_walk_call_walk(c, t, r, s, sz_ops_filter_passed); ktime_get_coarse_ts64(&end); quota->total_charged_ns += timespec64_to_ns(&end) - timespec64_to_ns(&begin); diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index cf8fb5a963d6..224873ca8aa6 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1454,7 +1454,7 @@ struct damon_sysfs_schemes_walk_data { /* populate the region directory */ static void damon_sysfs_schemes_tried_regions_upd_one(void *data, struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, - struct damos *s) + struct damos *s, unsigned long sz_filter_passed) { struct damon_sysfs_schemes_walk_data *walk_data = data; struct damon_sysfs_kdamond *sysfs_kdamond = walk_data->sysfs_kdamond; From patchwork Thu Dec 19 04:03:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914456 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 4D480E7718B for ; Thu, 19 Dec 2024 04:04:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55D896B00A2; Wed, 18 Dec 2024 23:03:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E9796B00A3; Wed, 18 Dec 2024 23:03:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 383066B00A4; Wed, 18 Dec 2024 23:03:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1970D6B00A2 for ; Wed, 18 Dec 2024 23:03:59 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C1320C13E3 for ; Thu, 19 Dec 2024 04:03:58 +0000 (UTC) X-FDA: 82910364726.11.2471022 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id D5DCE140008 for ; Thu, 19 Dec 2024 04:03:34 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YaWwkoMs; spf=pass (imf09.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=1734581012; 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=Uu32OW92SpNhL0I1vCbmQCnujB2lWgg4AoSWm3t9hqg=; b=kMm3muNfXub8yrJF+4P6lnGHvfEBb8MOyE2cBfcavsLF4+9FEkdFuY/+tJtD0/depYvZq2 jGGArsF/c3TPCKl5FAMfT8FJsKLMh8mdqvUzjTsHcJt281LGofGFyvU4vpBrHheJRShUrr 38G/WS31xJ1C4dvt/+j/eqBRDd2u/3U= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YaWwkoMs; spf=pass (imf09.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581012; a=rsa-sha256; cv=none; b=I8wDHWvlwGtGrwpr44NZaMTw3vEegizwnccF+FwsY7hQByeYPYfXAnI8ET8/jjpx3incYG ELvA0IQ7C6GVmr5V9/cmAy1wV6v+diOdAkFBZnNH/bcNRIXGy8Zt7zW678fVmXrb/Y0OEo P2RhPGlIsqjPPo+7fDVenqLQ3Uwgxps= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5E13F5C65D0; Thu, 19 Dec 2024 04:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E18E7C4CED4; Thu, 19 Dec 2024 04:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581036; bh=xGeZNDXz9ovPiTqa907jHI/cUugPY9TuP39+tm2J3DI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YaWwkoMsUq3M/9y90r30+fdbMg5W+Jtn+IphmKPouGNrvQno6svhKYfNY3O1U7Ziq mNLcPEeBaJaRmMhQ7P0n3pYFyDzFAB73gPOufPWOX9UDzeyWcKaICVL7iUmEWSATe7 u4uhvb0Xa28UgL/G5fN94kmI5VZiaUP5dwaljPbJA2IDw9maXLrBc9vYve1lraJTFe hXVB4X8EYz3EhThDwTJKR+DnvOfYdl9IRscCLTVQTEJp4AXzQ5bfEuYAZhu7TNbotZ BXfCCDArHgTD+uNgbG4FaASYkOCjh5j3mXe0ia+BNc8RxmM4OHlZ4jaEgLN5l2S3S0 G9yqOBRNkt8Vw== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 15/18] mm/damon/sysfs-schemes: expose per-region filter-passed bytes Date: Wed, 18 Dec 2024 20:03:24 -0800 Message-Id: <20241219040327.61902-16-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D5DCE140008 X-Rspamd-Server: rspam12 X-Stat-Signature: 1g4joau3gjj6wqxu8rhx86ohue3yw7qo X-Rspam-User: X-HE-Tag: 1734581014-934601 X-HE-Meta: U2FsdGVkX1+L/U9k6llvhSejzk52oXSs1XJPurgYc6WpMTDy8e2r3uA7scjDrvFW6lZWXDX3LcJj4nTDaLBAOWAzBXLv43Y12wui2PBfNf3oIwnsqMf48wrxM4IyfLRj+OxNtlBZptG064cGXSaNBWcxqoqNE1XmQ9d53Wx2F0SWR7xWJ1jFm8L/U9/OFR7ymKetT6HCp5m/o8DdxWjJ0phVuvPjV3yhyV0QNzFD6+ZIRV8LLjG8E/CAGuajS+Xyg30eVF6JS7iOTEFTwxy2On9wImb5r+rvIvpOmpol0guufL7e7zkmfLs4q8E688J+JbNvt3ur2ijGvikxDULQT2wchNEJkJMVK+jzpPIIkGChVeG0W4s7bun0cRpC/aF+NN8nEVi6mElpo2Lkp8qdwqv++l57CiwAcb3shnWdqHD18iLcpmNoAY9PAVvB+Sgxejg0FuKekvCDMrN9TBl3IhH5OxQngsPKt1rWQjlh7+9Y+becS/q8rs8qQANECA1CUxPs8swGiL2Hucvqrp6PXi2b4xyzGrsO2Cen6Q7Sw/9IXMU2Iv8pifGu7DXDbTuXWwG9p7iCpLjdZo1e6NrEuK2UwhM16hPfOWqj/Ql/T1Tb3uHTp2a7AFgZ1adfTZ0u1eu7jgP1XFTdvJPl7oK+juISRgFDtesGSgSJ/z72czEvzMpvkVzow4LrKlHUciVBfLy+ivZqUfd68BebdAZWI1zC4UL9TXOiP6IfiLeQmU2JOvit/vNYifGNMRZQ2R7LNO+CtLTkDe+VdactL8a0CqpNHPNETFg04fjL6Z/yNrBoNH104w61HIMKPNCtp++eDmmy+u+w4REFObuLlMHfVQnW2RlOiOVTayMhBoL/rPupbHhYiiSmE5U5gMO4rzDha9lkHeLEeCJPGTXybgsY8/O4gxW+Fy5hE/GrXeDcFH2QVlegUuRtLHE9jfosw4KYlKXYGXq9ADD0bPcsbkp uD76hGKh 3bavwGuEoryWt5F4KRWk5Jen2+dOI+Gm1LB475xM9QGHiayCj9hST6SX1iI/e1UVpwTMtgKPkZrl0dyHFcGNzkNgPhl7RdFTqWVs5bDaA2L9z7SmsjOXF/FoKPxO3VZyiK6nSaCB+ihfd5vCRVXE4VvwgkP9VidbsUsnJz1VW77EuijGKkdlt7JuyAkWJOyXK6GjmYxfn+AUeIPNu7BOJnIbBOYuK6fX9T1k0OsGsAt0IqzQ= 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: Per-region operations set-handled DAMOS filters passed memory size information is provided to only DAMON core API users. Further expose it to the user space by adding a new DAMON sysfs interface file under each scheme tried region directory. Signed-off-by: SeongJae Park --- mm/damon/sysfs-common.h | 2 +- mm/damon/sysfs-schemes.c | 18 +++++++++++++++++- mm/damon/sysfs.c | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mm/damon/sysfs-common.h b/mm/damon/sysfs-common.h index b3f63bc658b7..70d84bdc9f5f 100644 --- a/mm/damon/sysfs-common.h +++ b/mm/damon/sysfs-common.h @@ -48,7 +48,7 @@ void damon_sysfs_schemes_update_stats( void damos_sysfs_populate_region_dir(struct damon_sysfs_schemes *sysfs_schemes, struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, struct damos *s, - bool total_bytes_only); + bool total_bytes_only, unsigned long sz_filter_passed); int damon_sysfs_schemes_clear_regions( struct damon_sysfs_schemes *sysfs_schemes); diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index b447c412b02c..1da0594dde55 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -19,6 +19,7 @@ struct damon_sysfs_scheme_region { struct damon_addr_range ar; unsigned int nr_accesses; unsigned int age; + unsigned long sz_filter_passed; struct list_head list; }; @@ -74,6 +75,15 @@ static ssize_t age_show(struct kobject *kobj, struct kobj_attribute *attr, return sysfs_emit(buf, "%u\n", region->age); } +static ssize_t sz_filter_passed_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_scheme_region *region = container_of(kobj, + struct damon_sysfs_scheme_region, kobj); + + return sysfs_emit(buf, "%lu\n", region->sz_filter_passed); +} + static void damon_sysfs_scheme_region_release(struct kobject *kobj) { struct damon_sysfs_scheme_region *region = container_of(kobj, @@ -95,11 +105,15 @@ static struct kobj_attribute damon_sysfs_scheme_region_nr_accesses_attr = static struct kobj_attribute damon_sysfs_scheme_region_age_attr = __ATTR_RO_MODE(age, 0400); +static struct kobj_attribute damon_sysfs_scheme_region_sz_filter_passed_attr = + __ATTR_RO_MODE(sz_filter_passed, 0400); + static struct attribute *damon_sysfs_scheme_region_attrs[] = { &damon_sysfs_scheme_region_start_attr.attr, &damon_sysfs_scheme_region_end_attr.attr, &damon_sysfs_scheme_region_nr_accesses_attr.attr, &damon_sysfs_scheme_region_age_attr.attr, + &damon_sysfs_scheme_region_sz_filter_passed_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_scheme_region); @@ -2110,7 +2124,8 @@ void damon_sysfs_schemes_update_stats( */ void damos_sysfs_populate_region_dir(struct damon_sysfs_schemes *sysfs_schemes, struct damon_ctx *ctx, struct damon_target *t, - struct damon_region *r, struct damos *s, bool total_bytes_only) + struct damon_region *r, struct damos *s, bool total_bytes_only, + unsigned long sz_filter_passed) { struct damos *scheme; struct damon_sysfs_scheme_regions *sysfs_regions; @@ -2135,6 +2150,7 @@ void damos_sysfs_populate_region_dir(struct damon_sysfs_schemes *sysfs_schemes, region = damon_sysfs_scheme_region_alloc(r); if (!region) return; + region->sz_filter_passed = sz_filter_passed; list_add_tail(®ion->list, &sysfs_regions->regions_list); sysfs_regions->nr_regions++; if (kobject_init_and_add(®ion->kobj, diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 224873ca8aa6..deeab04d3b46 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1461,7 +1461,8 @@ static void damon_sysfs_schemes_tried_regions_upd_one(void *data, struct damon_c damos_sysfs_populate_region_dir( sysfs_kdamond->contexts->contexts_arr[0]->schemes, - ctx, t, r, s, walk_data->total_bytes_only); + ctx, t, r, s, walk_data->total_bytes_only, + sz_filter_passed); } static int damon_sysfs_update_schemes_tried_regions( From patchwork Thu Dec 19 04:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914457 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 3CD29E7718B for ; Thu, 19 Dec 2024 04:04:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EF6F6B00A3; Wed, 18 Dec 2024 23:04:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 867FE6B00A5; Wed, 18 Dec 2024 23:04:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E0D36B00A6; Wed, 18 Dec 2024 23:04:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4BAAD6B00A3 for ; Wed, 18 Dec 2024 23:04:00 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 081C516138E for ; Thu, 19 Dec 2024 04:04:00 +0000 (UTC) X-FDA: 82910364390.23.1B30139 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id B0290160008 for ; Thu, 19 Dec 2024 04:03:36 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qMRVKSH4; 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=1734581016; 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=oTGbewtjb9lPYWD1rVt5NUkFSU/frzGsmV1A/af4iuU=; b=6TeReUWRjW0rRc29jqtv51hgdjYS7rZuwib/3YZzcEygugcCet/S7jh33zebjEppLHF5E/ selc2Kcs5as4ymf55aVzmvJrtEU0bPBxTKNyqJz2UJBlgsfglcwfpyGX5l9osnkkrF2cD2 J1W8esQJsrq60UfKf1V8I+FzctB+H/A= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qMRVKSH4; 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581016; a=rsa-sha256; cv=none; b=NF1NQKeAxylutVwJWiZHUjZLvXtohffRcN4HGskkU5scI8WaUU9YBF4UYA8wLtseyJCUJj OJZkxzcRQvl4PhTtkjdsqeFecaoiadH4y2ZbzHLMGYdzY4B4bLuK++OQ7R+rIsMaQzHTdG /kCSZzc34CaBQylz0ZPCFbnZzqvPpAM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7F4AE5C6217; Thu, 19 Dec 2024 04:03:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A404C4CED6; Thu, 19 Dec 2024 04:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581037; bh=SFVsdgaR2hHAdxlVsqMnuhaABmN7P75BtajXxh6t/oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qMRVKSH40MOgCu29r5fBQZ0M8XOPYWcUwyzFJ7+iG2omCmV8DLvli9q84rxzlC/Jz fXJMUhBZ2uTeoeGb3DOG7JXXCiVX/0hC5GWT0OkekJ2d63I09IT6W4nkUCfUpa3a6u gzrmS0l7JxokrKW/+YyUNupEl1ypEqC+FAvC48o/AID0SQk6hm7CyMzBpgIaZ9IRrh xyVHol5hXqrio9JK6iT6rYVftCGCoTZJInzGgx5g8X0lIA8kSftPqPrc/UawfiL+S1 gaI3oGQitPLAq+gLyK5tJqSQphArUn5q9LvP+/7cpwyq1kZHVh2Np0WYBYGkmtt0Bs +4ALmwVqgmLag== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 16/18] Docs/mm/damon/design: document per-region sz_filter_passed stat Date: Wed, 18 Dec 2024 20:03:25 -0800 Message-Id: <20241219040327.61902-17-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: eudfgsuj4kqkcdxdi1aukwrjegshms1f X-Rspamd-Queue-Id: B0290160008 X-Rspam-User: X-HE-Tag: 1734581016-223028 X-HE-Meta: U2FsdGVkX1+yGO05EhZZJZAFvrZzbJyty723rWJB08vRuPUvn8FYT3wVtV3/KPEgF6jPiqFuvqzacibVdvI6AK6L5rDrRwdz96qAbTKQZxgHBIuZKajEG9iIqoRAVI+tqpJvAB72yF6xcjzmSfbGVPgR6rMUiPNE1R09n0OZ0rm7aXDiNciQY/xOyncRIsUk8F6xHHoxpZLN3yMiD2eBNXuRRioyufLtz1ZGDCjsh2LGUFSSNtJK7/k/74xMgNyZ8sWAsZQE2A1dCYfTIjT8yzv4NvlqSXoU2fQQv/wSV2q7buJOTFHPcLtANf8hxj2t1vu/h4SJ9GqfVC0IdfP8K9NKEFSj+Agtm5w+DvRLfmzDESitFmZvDVe2lQIxxuHDR1nH3zgru+TWHE2IaUKa4vCJVrNizpq+fo7Pc6vvGDEDeFxzEsteX/uGCaae3fVryVsaRvuSzwSloyEaGJ3RYztKvkGqgWg+s0UFj9htntAR55//tXTL3L1cuPl2T6eEF2iraUk+PTevy2ssyC2Fw/QrbLI5nfDpZ5FqE4KokgNQV5RUmFeJ9lQFK+Qe+aed+oP+5beVM1XWQI9uY83EpKjMyIapJDjMhceqiLK7spQ41XQo3gxwINPqXxc55/SntvnX3C1uMrJElfSDs+JyON+CGxVA5TVNx4QPZ6dG/l2hrATljRd9AE35ovCobRCjzOi2iy5eBjjYedByVjtvPalSu//gglCuZMrLS1SWhoyif3wQV3v41Lbrh793Y5r0K8xHgSw2kml5ILfGKagZQ9MxfDdGQ/jOUQ06BtQTIBfQJRXBHP586/7mKG3iLloLHD8lKU6k/Y1JHTncOKTlVO43kOhM3pw8MB6hPBjJtnye9Dg7Ux0rjx0EosUQoJgv9j63BELQkN6JQUPRFt41bPgqJ6nEeNik7EbVcJzpPbzpuCFQybWRDHPGcQQFiCXjvg5bmJo9D8+f535IQvw djH0JlNr 84HPkGCx5tb7TU0ugJzZVsr37OjtiID8I3SUmfdUZ2sKguBcYcvkUaRyosusk22OptJu6unyHNKUc25wW+DXUsY4N8I9wXszWH0+aSRmBhxKr+ssaqgGHFGxiJ9FOrOY0v5TfTyKKLvcBdU/2FbYFOm5SSXIOWvo3YD5ccvVU0kRqvh/MNXTBsIYCHQ+KmD9uXz6SosuzZO6zgZ+RyNrrwkj/6QfusTx0BK015jrr72h4/pd4yS+J2D0yzrPBm0ymnu86OfKviqHPmDDG2DnMjHXe07VDhR/Chf1a1rw7SWohxxBvD6j8F0+NUg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000265, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Update 'Regions Walking' sectioin of design document for the newly added per-region operations set handling DAMOS filters-passed bytes. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 0620675a1e8d..ed3072dc8686 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -586,7 +586,8 @@ Regions Walking DAMOS feature allowing users access each region that a DAMOS action has just applied. Using this feature, DAMON :ref:`API ` allows users -access full properties of the regions including the access monitoring results. +access full properties of the regions including the access monitoring results +and amount of the region's internal memory that passed the DAMOS filters. :ref:`DAMON sysfs interface ` also allows users read the data via special :ref:`files `. From patchwork Thu Dec 19 04:03:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914458 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 293F8E7718A for ; Thu, 19 Dec 2024 04:04:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9CB6F6B00A5; Wed, 18 Dec 2024 23:04:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 97A076B00A6; Wed, 18 Dec 2024 23:04:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 817286B00A7; Wed, 18 Dec 2024 23:04:01 -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 5E4926B00A5 for ; Wed, 18 Dec 2024 23:04:01 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2C42D1C83F3 for ; Thu, 19 Dec 2024 04:04:01 +0000 (UTC) X-FDA: 82910364810.11.5CC254E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 5906A1C0019 for ; Thu, 19 Dec 2024 04:02:57 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tEFCee2b; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581024; a=rsa-sha256; cv=none; b=cfGXpeDv2TZQ9h2kATiNMXExxOAu98I3xRyRKAuB+KgVAJHkVYQ7QsH1TWZwCqJ1Wobsth vNq/zraJzST/PKE6lEcmVN6d6uoxPJQ9CFYZfs9+z40kjMHAIbqgnvBQwYa4tUUA/UFno/ rl5xEVi/fkGXNrPx5aUNAnv0QokZXzU= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tEFCee2b; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734581024; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J5RSSWXzP8dqb+n8valbxerEuRc0ZfJo6cDrPOu7DNM=; b=ITvNJ3qhF5gk/1BvYy6FTUK9hyf2MuDuUvuUBYcNqzSojxl0SPPxNRIYxRDe9QtLleGSxU 5HKejcNuIN+pN/HMdQnBugVKtDUlV/gEVdSNC8SEBkVBXQyO2Pgo/Uam/y3ryQusgiSDxW jJN20VWkcNsWSjhIjfx5H9OBDzts+Gg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BCEE45C6627; Thu, 19 Dec 2024 04:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39983C4CED6; Thu, 19 Dec 2024 04:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581038; bh=h5r/y4q9OO288YZFlZV7V3CQiTTX7mBJ1xQ9QZ3zXD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tEFCee2bmSQtQ9UaGk1XPKYTROA/k1oiKvsqBrXetaeL9jreOXIZlDthVtyNK0w6c QTITd37deEBoPOY8rnjNAMMzSBeAWlyBG4HYLyL1SkvRmk3NXHGDoYnQpwH0Wcso03 NR7zGEGK8Ki1cWIuqOilbajHjbrnuc0ToyKh0aX8S+AkqiiErZDO+cYHxYzkNXohkO TMpZXT+pUp1u4Y33yM44o6NPzGnmjB/MsOql//UzofnTPvF0qz3C6Izsidxq2ukucH vbRvVhcePmcwnQnFSbQsQUCyszB1kiMpBlfQPBiri4PbsCDalpVjkjfDyswWc4Fo1L iHSkkL0K7yX3w== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 17/18] Docs/admin-guide/mm/damon/usage: document sz_filtered_out of scheme tried region directories Date: Wed, 18 Dec 2024 20:03:26 -0800 Message-Id: <20241219040327.61902-18-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5906A1C0019 X-Stat-Signature: r958se49k5wot6joa1zhrh5541js1m1g X-HE-Tag: 1734580977-580272 X-HE-Meta: U2FsdGVkX188r7teZ3wMthap5uHluGrlqS3NTblcYYutFecjr4P7aX2MKVO5nbk4J3LV4KAN68OeXRkclWawpEUihB7vWv1d54O3JyD4+z8XtiH/Uu/eH24f8h/5kvdDy+m9T65gTzaHKhkHMQcku/JwLAyr8ckjhw3z33qHdNliQ4nu5mMc69/5Fn8vNb4grACUAd/kAObZATdHB4ee4LmIjexQyrqU3QzOinInHIbxmNmdd5nOqn9q8zqj1Rvd71egSAna9BApolZQH7BcohPKBv/cGWGf9otd7wn0zRVuur9gh+wwZud5MA/20DV/507xzvWAbzKuRN295OIyB/77vquVI95XRwL/9d2dhRgssKqcINfZzlIvQfsSS4Z6SFpI1/QTNGH2UQBzFPbEmGTiCnfnTZKPtNRIKm6hCn02gUVfQVW4Q9T5bGZoU78vpQp1zR+IKNR91lOgcbrIWcsatVnnZtOVDEeXoSDNe6oDwQtwEl3WvdwXprZaWbIZM2+YzagAy6TxqtjGvSrnVJsH2MEqByI+9nxGKgGM550qOdBT6BIIqTEfh/7hEPzhPGowCyhthpvto3qx4Tcm94tJtlM0/AzHwW05W/f8DVzSTM1nIQmP6XD3AxR9YlzzRYXEyKxW7rIHQjki76UtOZpeZehCXl21YeHjD7p/fzhR2lBedVAD+F40Bxda+ASgLkcY4KY81E2O3vaNDuV4YjYfDmoEn8XI1zKTEwIXfGXEdbop/zIpXrLgwX3EriNhAHtnSGTy7Dfju58PqXG/obuetBgcaO/D5ItmBLZxGy7AHTVGQwZiWOvQ+uPNlcxVpgP1obfuPrYDDX5oMY8np0yOJvCZhLnC7koKK9lzC9pu31Khj2bnuH215hEMSb/ELzt5EMz+BDZy8sqFWtRYEFeU/FNmoGgyYFvZ1g5qDRni9emOKj+asjUps1NqIAb08Dx4L1NORlVRmHKvt/I B61RB5fb lztwk2x5t9rxha/WXowN0clMpfJBMwW8WrxhXy6vnui/YxwyAssfXtarDO7XWT2RPfFpwc+3IyzF+KTuMWaYc6Sp+SlIdu2w3BDTm9rdkC29pianu/J+UxWpclnklNHeG23dSNAHDz7OlF1qw6RtQIX8vkTNHalBdHP7rS76gS5AWyFaeJ5p5VAmgMYgf+hMN3a72zjjALzF7JF45EjnXrgBCywJwRmKGsEizvsXEBRoUP8m/vVdNOs0xYiHaj4Vly+JkRFISioGDMyirjY5aAybvygkP038581tg+Vi1ZV8a1gFBPI4exVDpgg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000451, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Document the newly added DAMON sysfs interface file for per-scheme-tried region's bytes that passed the operations set handling DAMOS filters. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 179a9060a32e..a891e830c2a1 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -92,7 +92,7 @@ comma (","). │ │ │ │ │ │ │ │ 0/type,matching,memcg_id │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes - │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age + │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ ... @@ -500,10 +500,10 @@ set the ``access pattern`` as their interested pattern that they want to query. tried_regions// ------------------ -In each region directory, you will find four files (``start``, ``end``, -``nr_accesses``, and ``age``). Reading the files will show the start and end -addresses, ``nr_accesses``, and ``age`` of the region that corresponding -DAMON-based operation scheme ``action`` has tried to be applied. +In each region directory, you will find five files (``start``, ``end``, +``nr_accesses``, ``age``, and ``sz_filter_passed``). Reading the files will +show the properties of the region that corresponding DAMON-based operation +scheme ``action`` has tried to be applied. Example ~~~~~~~ From patchwork Thu Dec 19 04:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914459 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 E31EEE7718A for ; Thu, 19 Dec 2024 04:04:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97B346B00A6; Wed, 18 Dec 2024 23:04:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FFD96B00A8; Wed, 18 Dec 2024 23:04:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C9B06B00A9; Wed, 18 Dec 2024 23:04:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 59EB06B00A6 for ; Wed, 18 Dec 2024 23:04:02 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1A49E813E9 for ; Thu, 19 Dec 2024 04:04:02 +0000 (UTC) X-FDA: 82910364516.10.A1975DE Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf17.hostedemail.com (Postfix) with ESMTP id AB21D4000C for ; Thu, 19 Dec 2024 04:03:35 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=oyHjZIYK; spf=pass (imf17.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1734581025; 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=vvr2qABIzHiFKBWJgAYDA0yAaS8oSG6526R0C9e+Uxc=; b=nsTV34D9H6BWpCUiunMhCud0uqz5p8gVYTZWCpdtotoSHwSZhmTa5RH4TxtbQE9LJ2qyMP AwRiFvK55uo7sUao8VI+Fi+zvxbH9zqZF+7nXY1VGFX/8SfTN/jSY08JGaSptk6LwWvqQc i3f5GyM8VEwib/DMKI1JfyidoEmm6+A= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=oyHjZIYK; spf=pass (imf17.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734581025; a=rsa-sha256; cv=none; b=eTT0s+Hs/H2pJU7su+hAuRyqxGzASwkS5Hc3lPYFxIbIIGQFvtZmthIeT2XtMy7nq6QXeg KGOvs753t4VEcrhLEQMoe9VU+gkg8N+xowDFJP91uMio5Y/FiuGctX22xeOuaqyUKm6ACl QfE0PgE0ajxCYTyMP3m+g4D9kxv4h84= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 4E28BA41BED; Thu, 19 Dec 2024 04:02:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E52C4CED6; Thu, 19 Dec 2024 04:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581039; bh=3O+7JbZj6xxSI8uZRXk/Ms1BG1Ir2OifGM6jxU273yY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oyHjZIYKBbVSgEhHGsO/L49GzSrPmCAgLz3fFw3/HiFralNETAuZ/xTMhWDGJXTop QBBl9+e7s1mwviBijmuPa9POKEy+exmlGwdq0d5k06jwod7XgV5Ow8/9wORT96nt+d +uK75NV2pS0UsBJY4qLo1AcdejSh1io5Ii6XO8xRoaX/NCa0nvdkVdQ1wckbVsHAyl 49KZ+XdOZVsWih75jtrhbzfIkLTMkfttpVQ8D0NLP/d6ggynxGTd7owaTR9zwO7h6U 8x8ZYgu2vu84k41iryaUEfawSQ2BjIbTbTVf/bAnlEfHhk/TNhX9gCWCq5XBPoF6ZX 7lF4h6r8PjWbw== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 18/18] Docs/ABI/damon: document per-region DAMOS filter-passed bytes stat file Date: Wed, 18 Dec 2024 20:03:27 -0800 Message-Id: <20241219040327.61902-19-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: AB21D4000C X-Stat-Signature: 56pfg76znjyj4gkuy4xshp7oj5gousem X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734581015-849069 X-HE-Meta: U2FsdGVkX1+CkEVWON0ndIIOKQBfA5SHt8F7seDFDMpuG0FogIcBUcDI9Wib4bPFE4seNITdcD8JFX70gpE5p/GzLHpVJj5AcgL8bycxySpPcFNhpsMYfzRR138YQd7LnKBvv3zyB/VkdkuRQzY8vBnzJwyjiryq803GIkuilOsjTzkIqn6WVgR1HCpkHFrlOTZjFKmL4LCkcHmIkMPoy9CUmuUB5BkGHNQWyVXQSw8suEj9cF6VjSbyK1bD6aFrjdCpHPn1ny0IaOeup8/GpKLLJgBkcg8g81dtqdrDVXtS9MFhskFBr/KJ+C5SU0WLT4eZ00S+A3ogK/BNIdFxoZKVEJDUQuXhZ746y1my3Q3x8/wsmq+2X+qstrd5YuNWZYUcy6YS1tbqsJOnEJVOW/osCGol6Ke92s+QCdFcwN7Jk+7hwa2zYjw/NNE1lm5GcxyF1G4OLTsb1+PNiAkhGJRWGbWAvXr5Xbm7cSofAXh0bdVhji+Nc2w4YMQT5vQaFcfG0+8+VR36R2ocUAoCDlYjhJmuze1c7mSqC2myW8LtMWVHZnSRSGZK/tsRYj+vwHdtnlVNOZip4NiOZ5gY64pSPvHUA16wVjiC5G8HaWSvr5h+2EacAYRG6ssjLBoHSr/9zYoGS+CJEEcR9sSRlYgbn1aagQw7jMJPRi6OJcZJVE6m1CRsnqqe06O5B66NRSno/gHK/JWQkq2+jmXg5jJcr8rK18ygnHBlRCTet1coR0YbMbelVVocBc4/U8TP6aBbsnRRFk15N/FVv1+FKpO5tQ7+Pk2MtYjJL+Cxm173hHDBKhUdWaGF0Bi7most+myK006Zz49nD0wVq4B1j44OUqjFMkUKQMPJI5rTxpYByND4j3jaNhDbd/gqaBOdBLvSqC+HXEmohjoN1z44/ofjOwzKgJbZt08HQTRC2RltHeeaz5RfcE49otGIrV3Oy2bKTeYNEbT2BqvdmMt d16j49zv IY7Aby0roZgYgbq3hTv/Pg1Yq2lKBHRehECULWoSlWrHzCpToGyD6Lfy82P/bXFsUt/kwhR1Pk8R73DwOO+ZXYZGRoUMMFr3/Xdca3GShgs5Hhngu74ktirqBPEh0toakIdC1qvTptlAoiuZo0tMpNhuG6VIH+t5Jbpi+mCX31aK0IelH2CslHOhQuGl197iUJoRXnfO38qqdaK3I5qyLFW6Eau3I8xmoRSugWH+ZLq7eQQI= 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: Document the new ABI for per-region operations set layer-handled DAMOS filters passed bytes statistic. Signed-off-by: SeongJae Park --- Documentation/ABI/testing/sysfs-kernel-mm-damon | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-damon b/Documentation/ABI/testing/sysfs-kernel-mm-damon index 19cde386fd15..8c0acb31638b 100644 --- a/Documentation/ABI/testing/sysfs-kernel-mm-damon +++ b/Documentation/ABI/testing/sysfs-kernel-mm-damon @@ -430,3 +430,10 @@ Contact: SeongJae Park Description: Reading this file returns the 'age' of a memory region that corresponding DAMON-based Operation Scheme's action has tried to be applied. + +What: /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes//tried_regions//sz_filter_passed +Date: Dec 2024 +Contact: SeongJae Park +Description: Reading this file returns the size of the memory in the region + that passed DAMON operations layer-handled filters of the + scheme in bytes.