From patchwork Wed Jun 3 14:11:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11585719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF21A618 for ; Wed, 3 Jun 2020 14:12:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 824DA20825 for ; Wed, 3 Jun 2020 14:12:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="aNasTH6H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 824DA20825 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9283F8E0007; Wed, 3 Jun 2020 10:12:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8B2538E0006; Wed, 3 Jun 2020 10:12:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7533C8E0007; Wed, 3 Jun 2020 10:12:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 5AA688E0006 for ; Wed, 3 Jun 2020 10:12:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EF2CD80204ED for ; Wed, 3 Jun 2020 14:12:29 +0000 (UTC) X-FDA: 76888090818.28.leg94_4fe0bbcfcfe03 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 4A8162D390 for ; Wed, 3 Jun 2020 14:12:29 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=416e8e2f5=sjpark@amazon.com,,RULES_HIT:30003:30012:30051:30054:30064:30070,0,RBL:52.95.48.154:@amazon.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: leg94_4fe0bbcfcfe03 X-Filterd-Recvd-Size: 7007 Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Wed, 3 Jun 2020 14:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591193549; x=1622729549; h=from:to:cc:subject:date:message-id:mime-version; bh=VSSWvrN/6ooCF8jN2b2oKAZsBnPFQ1RB7gDwHK0r5D4=; b=aNasTH6HaEjK8tTVsGuQvODTnVcuBQe0IENjrHWtqp2CWi9eD265D7cF Na5seeJB0guAHBqU6dSgW2Uos9wzU/9q2Knu42B20zvul+uftQvq9sjqy 5ZawGcgxfB0CvoYq1PwqmId3mjIuaGW2T6FfS7/khclk5G7Mj8y5nE5H8 E=; IronPort-SDR: yCKBXwgrtQgb/fi7ejpvwX8zGmhPIgPob1X0YePWNE2rKJke1i0rPsb1y5UjPcmOq9TMn+Nxdz Vsg8FwzHCUzQ== X-IronPort-AV: E=Sophos;i="5.73,467,1583193600"; d="scan'208";a="35572869" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 03 Jun 2020 14:12:13 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com (Postfix) with ESMTPS id 47D09A22AA; Wed, 3 Jun 2020 14:12:10 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 14:12:09 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.90) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 14:11:52 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v2 0/9] DAMON: Support Access Monitoring of Any Address Space Including Physical Memory Date: Wed, 3 Jun 2020 16:11:26 +0200 Message-ID: <20200603141135.10575-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.43.160.90] X-ClientProxiedBy: EX13D45UWB002.ant.amazon.com (10.43.161.78) To EX13D31EUA001.ant.amazon.com (10.43.165.15) X-Rspamd-Queue-Id: 4A8162D390 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: From: SeongJae Park Currently, DAMON[1] supports only virtual memory address spaces because it utilizes PTE Accessed bits as its low-level access check primitive and ``struct vma`` as a way to address the monitoring target regions. However, the core idea of DAMON, which makes it able to provide the accurate, efficient, and scalable monitoring, is in a separate higher layer. Therefore, DAMON can be extended for other various address spaces by changing the two low primitives to others for the address spaces. This patchset makes the DAMON's low level primitives configurable and provide reference implementation of the primitives for the virtual memory address spaces and the physical memory address space. Therefore, users can monitor both of the two address spaces by simply configuring the provided low level primitives. Kernel space users can also implement the primitives by themselves for their special use cases. Clean/dirty/entire page cache, NUMA nodes, specific files, or block devices would be examples of such special use cases. [1] https://lore.kernel.org/linux-mm/20200602130125.20467-1-sjpark@amazon.com/ Baseline and Complete Git Trees =============================== The patches are based on the v5.7 plus DAMON v14 patchset and DAMOS RFC v10 patchset. You can also clone the complete git tree: $ git clone git://github.com/sjp38/linux -b cdamon/rfc/v2 The web is also available: https://github.com/sjp38/linux/releases/tag/cdamon/rfc/v2 [1] https://lore.kernel.org/linux-mm/20200602130125.20467-1-sjpark@amazon.com/ [2] https://lore.kernel.org/linux-mm/20200603071138.8152-1-sjpark@amazon.com/ Sequence of Patches =================== The sequence of patches is as follow. The 1st patch defines the monitoring region again based on pure address range abstraction so that no assumption of virtual memory is in there. The following 2nd patch cleans up code using the new abstraction. The 3rd patch allows users to configure the low level pritimives for initialization and dynamic update of the target address regions, which were previously coupled with virtual memory area. Then, the 4th patch allow user space to also be able to set the monitoring target regions and document it in the 5th patch. The 6th patch further makes the access check primitives, which were based on PTE Accessed bit, configurable. Now any address space can be supported. The 7th patch provides the reference implementations of the configurable primitives for physical memory monitoring. The 8th patch makes the debugfs interface to be able to use the physical memory monitoring, and finally the 9th patch documents this. Patch History ============= Changes from RFC v1 (https://lore.kernel.org/linux-mm/20200409094232.29680-1-sjpark@amazon.com/) - Provide the reference primitive implementations for the physical memory - Connect the extensions with the debugfs interface SeongJae Park (9): mm/damon: Use vm-independent address range concept mm/damon: Clean up code using 'struct damon_addr_range' mm/damon: Make monitoring target regions init/update configurable mm/damon/debugfs: Allow users to set initial monitoring target regions Docs/damon: Document 'initial_regions' feature mm/damon: Make access check primitive configurable mm/damon: Implement callbacks for physical memory monitoring mm/damon/debugfs: Support physical memory monitoring Docs/damon: Document physical memory monitoring support Documentation/admin-guide/mm/damon/usage.rst | 56 ++- include/linux/damon.h | 47 +- mm/damon-test.h | 78 +-- mm/damon.c | 504 ++++++++++++++++--- 4 files changed, 564 insertions(+), 121 deletions(-)