From patchwork Fri Apr 26 19:52:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13645327 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 6597FC04FFE for ; Fri, 26 Apr 2024 19:53:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30C7E6B0098; Fri, 26 Apr 2024 15:53:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BD036B0099; Fri, 26 Apr 2024 15:53:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15F1D6B009A; Fri, 26 Apr 2024 15:53:07 -0400 (EDT) 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 E86556B0098 for ; Fri, 26 Apr 2024 15:53:06 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 997F1C0865 for ; Fri, 26 Apr 2024 19:53:06 +0000 (UTC) X-FDA: 82052731572.25.5CC5592 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf30.hostedemail.com (Postfix) with ESMTP id D02FB8000C for ; Fri, 26 Apr 2024 19:53:04 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BVVGWpEo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 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=1714161185; 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:references:dkim-signature; bh=5nVREtd0aJ2AfnMkIMgDH0zHIL0ORKSsXBvwLFfiYxc=; b=GzpwXiBrNn/mwNT7pXB7zkU7VolIzHRNsH3NOAGtsX5IsBq1y+Ler0s1Hv/WIZeL4qyDYo AqTm6lfaIn0xEDe+w471UqArc8B9tQUuwzTIyp6GdEcZSU6EOCoZXny4phFgVtw0j3s8Hk n13dFKeGLtXusocrJMYVEJA/QgWSN8E= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BVVGWpEo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714161185; a=rsa-sha256; cv=none; b=xg2BY99ernodLVuC4L1C5YbPUWtTMj0vtI+NP1SOwZ0hFhGR1nkCDLjSm0uKnhMSA8mcNf IJ9zwuzA7pr3dTeluy5F3qJrzxQA+rFc+nb7CalFkhNpih9rqepvZL0SUr/0I/deTz1mOi bytpONzs/GhouXIkWivehs0spAiqHsM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E640BCE1CFF; Fri, 26 Apr 2024 19:53:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F525C113CD; Fri, 26 Apr 2024 19:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714161180; bh=KDQABXFXICsHnj+v3YhXIoEGy+Tp7EqKpAZ8dhNvvfY=; h=From:To:Cc:Subject:Date:From; b=BVVGWpEoAs/HVIHW1jVbh/MGwqLjrbJJESwz32Kkj9LuwJ2IL5OXifVSlfWAbA5Ce eECBaZlWlXZF+bSDyrZlFkjGOW4iDt41a/tmJEaGcI/iDhioMwYsXYr/Owm3d0OTyR y+m4GRFg5UXOJKz58ElhqUoqEDxSmOFWLDTtSHiPi2pHWM+VTGbmMk6bU19VkD74m3 snsA/YQyeJQLeZIknVZcuxpLWlGx/U6PNcEM4UqVF/jmIGZAJQIOv6US7qQs3TRcDh xlBqfihJ81nPUHd5Tl8XMItzJDDpmZzyxY27WnknsG1uuK7ipjIezKg9PR6aT9T8Xi O8hDAE9+BMYzg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/7] mm/damon: add a DAMOS filter type for page granularity access recheck Date: Fri, 26 Apr 2024 12:52:39 -0700 Message-Id: <20240426195247.100306-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D02FB8000C X-Stat-Signature: 8my57oqtp9qwrum3zaxnx88ezogwuysy X-Rspam-User: X-HE-Tag: 1714161184-845360 X-HE-Meta: U2FsdGVkX19hSsnNvtyLuOWoWedPuZQRUOtngFhxQS7GNNmkjAlVFMCEf184/kOxaSYCzcMv3uwsxc/Mmir6kqydFo5Z3EB6b7y3gIalOeXHNtkcVYYq2Ep+CVcuD8bKPN0bgpOzDnYEWZn6NAax1zg5Ynu+nX2pUpIhn0pUzk3Ww8I3mxG2ag/fhXhuDNT/LY4zqq17Tq5wPyfw9uQW6mljt3zCJPCrhkikUodoHrDFItQ7dobXfpSvkPB3aJADWBxCVkBzgCIOYaGfQ//8uL5ceuTfCJ4wym59lE9ORcUef2sbVucveqnrwfomG2ACLewkmugykbGkW/hh+iwM/0oGF5mMu5ZhfC2Z5OHzgIPFgwFKIgaZHYt2GkaQTgFRJib24HeuNqPmSNEqUM+NMTVjPxtlbx27COxxDbzKglQ0Pkg8IP0WStBf7gXOXGpYmDfOoIciSifNUXeGELKsLgeJIPGVsIhqd7cUnhJH4Kkqcd77Q7j/jTjNtogLyyMM3TbtcNK23XyUJ6j0HZzozEFqCFCFJDx/CmqASCzGb79FE0XVxG+i5FAfP9Z8lzUAZ1/8y8WRhrO2HqGT94UT/nRbB65syXict/99lJWPBs6mq/Kx8gN6fW9K9X3QAdghmRa0F8KIbnRpdHgo4ASmBx7aiqiShqRYEaHsgSpUZIrJTk5ylTjGEEPVe4rBj9HB2RZ1Jhs+nUtZp7O4g4lZ27YLafiWnQpZPFcpVmQ++XoqR5zJkXk9itYHo0lwJ+OQe3KzHIunrBmIEznNMRjC7ZFB8pi89NlP3PCCgi7Fx6bvBRb52WPdPBjxM0TxsBQaGaQR+0gGUp2BRQXaWsOxiXKXFCsW61gIxVsxslzFDjzdOBLTtDLTbNJ1gNOwtdNRJnS3MlbIAlN92pSpjdnfBni2ROsakB+cb4Hped7FSk4= 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: Changes from RFC v2 (https://lore.kernel.org/r/20240311204545.47097-1-sj@kernel.org) - Add documentation - Add Tested-by: Honggyu Kim - Wordsmith commit messages Changes from RFC v1 (https://lore.kernel.org/r/20240307030013.47041-1-sj@kernel.org) - Mark the folio as old if it was young - Rename __damon_pa_young() to damon_folio_young_one() DAMON provides its best-effort accuracy-overhead tradeoff under the user-defined ranges of acceptable level of the monitoring accuracy and overhead. A recent discussion for tiered memory management support from DAMON[1] concluded that finding memory regions of specific access pattern with low overhead despite of low accuracy via DAMON first, and then double checking the access of the region again in a finer (e.g., page) granularity could be a useful strategy for some DAMOS schemes. Add a new type of DAMOS filter, namely 'young' for such a case. It checks each page of DAMOS target region is accessed since the last check, and filters it out or in if 'matching' parameter is 'true' or 'false', respectively. Because this is a filter type that applied in page granularity, the support depends on DAMON operations set, similar to 'anon' and 'memcg' DAMOS filter types. Implement the support on the DAMON operations set for the physical address space, 'paddr', since one of the expected usages[1] is based on the physical address space. [1] https://lore.kernel.org/r/20240227235121.153277-1-sj@kernel.org SeongJae Park (7): mm/damon/paddr: implement damon_folio_young() mm/damon/paddr: implement damon_folio_mkold() mm/damon: add DAMOS filter type YOUNG mm/damon/paddr: implement DAMOS filter type YOUNG Docs/mm/damon/design: document 'young page' type DAMOS filter Docs/admin-guide/mm/damon/usage: update for young page type DAMOS filter Docs/ABI/damon: update for 'youg page' type DAMOS filter .../ABI/testing/sysfs-kernel-mm-damon | 6 +- Documentation/admin-guide/mm/damon/usage.rst | 26 ++++---- Documentation/mm/damon/design.rst | 20 +++--- include/linux/damon.h | 2 + mm/damon/paddr.c | 64 ++++++++++++------- mm/damon/sysfs-schemes.c | 1 + 6 files changed, 70 insertions(+), 49 deletions(-) base-commit: 4b4dd809460911d6c406bb45d2c627a9e5734468