Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1413129pxa; Thu, 20 Aug 2020 10:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf5wSuLrLKPbNc0R8d75ok86GGhUgQE3rEfUA66BFjWY2LqG6vsnq8XIP8kXVrlypmSFyu X-Received: by 2002:aa7:d809:: with SMTP id v9mr3955563edq.94.1597944988758; Thu, 20 Aug 2020 10:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597944988; cv=none; d=google.com; s=arc-20160816; b=N3Fbxr5DUB/U0gi2FWVf27I43+/13C7g3/kF7p1fcxqy5QSMS56g/sf7Mbv9+y8s2J sw5iLE6SRQ5biKIA91FjE6OibSnpTJGlMKugUF3ZQLjuuMvXUwKjuw//ycHIpo60TEai zenkUat0KRnHYAYvAZK+oSpWtQR7MacJOxisMv4S640cleJ0iSx4l5bmZb/oOtjfrQCc WrWfaF7qfH4kz82z6yv/X3zpaZaHgBWTiqFmb+PbGrvjzP4qQ/DPAJhEF71WBBoIIqda qkUAzDKvZOtPLg3JQflSxe1xVXHopIOttNBAZ/WpoX/X/JJatcOTznCQnT8obuXRh7vT w9Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MEA3ZhuWPoS1IieuWPGBAER8PruyG5EIp2kQWXV3Uws=; b=wLKwZZWJJzpVes6T192SdwjZiFwnnWd5k8M/dwjKoWGB22CoqzC93n6jcf66i7ED7E /jIxVihpu6IF7dBAsP/xKBiTa+sZTBmmAi8LXv6wq7LCRpowCPTqyVUO8eGKW6opgve7 npfLQTCtJ2vyOnzVKgXqxDOynIfhuJIn7Bq+UJyn281M5Z6DQUMw6wb72h6ZiKVoEtC1 hjHx5weX8nmRzHuulhAj79xOL5iNzniKZ+529CneHWlA38jM0wM67RiyttTQngDMXfkH HKxj7+QXAvbkoeK9oDXlGIgA7pQ9GpgyaaCBjkDY3B4ITP3ofXhPZuEmRyMD7gVng7Qf 7iCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=okiHBEmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id le18si1445118ejb.705.2020.08.20.10.36.04; Thu, 20 Aug 2020 10:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=okiHBEmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730655AbgHTRe1 (ORCPT + 99 others); Thu, 20 Aug 2020 13:34:27 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:2074 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730620AbgHTReJ (ORCPT ); Thu, 20 Aug 2020 13:34:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1597944848; x=1629480848; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=MEA3ZhuWPoS1IieuWPGBAER8PruyG5EIp2kQWXV3Uws=; b=okiHBEmAad8HTbk2suf+KuvP1XdldNIUn0DWCyIR2xmdMG4/pi8ORw8T nFAdoK2xDvvHyM6H65lCV9FlBgTepp2GQtMkYy+j/OqZnEdc6IKfrc/v2 CMnEbABqth65XKvmBpF/lBfy2+wCmHPYfQ0A80UFILGp4HpPwdtrtKblS Y=; X-IronPort-AV: E=Sophos;i="5.76,333,1592870400"; d="scan'208";a="50392757" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 20 Aug 2020 17:33:54 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (Postfix) with ESMTPS id 21249A211A; Thu, 20 Aug 2020 17:33:42 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 20 Aug 2020 17:33:42 +0000 Received: from u3f2cd687b01c55.ant.amazon.com (10.43.161.34) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 20 Aug 2020 17:33:25 +0000 From: SeongJae Park To: Shakeel Butt CC: SeongJae Park , , "Andrea Arcangeli" , , , , , , Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , "David Hildenbrand" , , "Du, Fan" , , Greg Thelen , Ian Rogers , , "Kirill A. Shutemov" , , Mel Gorman , Minchan Kim , Ingo Molnar , , "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , , , , , , Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , , , Linux MM , , LKML Subject: Re: [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring Date: Thu, 20 Aug 2020 19:33:10 +0200 Message-ID: <20200820173310.18933-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.34] X-ClientProxiedBy: EX13D27UWA001.ant.amazon.com (10.43.160.19) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Aug 2020 08:44:33 -0700 Shakeel Butt wrote: > On Thu, Aug 20, 2020 at 12:11 AM SeongJae Park wrote: > > > > On Wed, 19 Aug 2020 18:21:44 -0700 Shakeel Butt wrote: > > > > > On Tue, Aug 18, 2020 at 12:25 AM SeongJae Park wrote: > > > > > > > > From: SeongJae Park > > > > > > > > Changes from Previous Version > > > > ============================= > > > > > > > > - Use 42 as the fake target id for paddr instead of -1 > > > > - Fix a typo > > > > > > > > Introduction > > > > ============ > > > > > > > > DAMON[1] programming interface users can extend DAMON for any address space by > > > > configuring the address-space specific low level primitives with appropriate > > > > ones including their own implementations. However, because the implementation > > > > for the virtual address space is only available now, the users should implement > > > > their own for other address spaces. Worse yet, the user space users who rely > > > > on the debugfs interface and user space tool, cannot implement their own. > > > > > > > > This patchset implements another reference implementation of the low level > > > > primitives for the physical memory address space. With this change, hence, the > > > > kernel space users can monitor both the virtual and the physical address spaces > > > > by simply changing the configuration in the runtime. Further, this patchset > > > > links the implementation to the debugfs interface and the user space tool for > > > > the user space users. > > > > > > > > Note that the implementation supports only the user memory, as same to the idle > > > > page access tracking feature. > > > > > > > > [1] https://lore.kernel.org/linux-mm/20200706115322.29598-1-sjpark@amazon.com/ > > > > > > > > > > I am still struggling to find the benefit of this feature the way it > > > is implemented i.e. region based physical address space monitoring. > > > What exactly am I supposed to do for a given hot (or cold) physical > > > region? In a containerized world, that region can contain pages from > > > any cgroup. I can not really do anything about the accesses PHY-DAMON > > > provides me for a region. > > > > Technically speaking, this patchset introduces an implementation of DAMON's low > > level primitives for physical address space of LRU-listed pages. In other > > words, it is not designed for cgroups case. > > So, this RFC is for a system running a single workload which comprises > multiple processes. Instead of registering each process with DAMON, > just monitor the whole physical memory, right? Right. Also I assumed the kernel space DAMON users as the primary users of this feature. > > Though I am still not sure how the output from DAMON can be used in > this case. DAMON told me a physical region is cold, how do I find out > processes that have mapped the pages in that region to do > process_madvise(PAGEOUT) on them? Seems you are saying about the user space DAMON use. Indeed, it would be quite complicated. For example, maybe the user space could read '/proc/pid/pagemap' of every process, but this really sounds awkward. Thank you for pointing this :) Even in the virtual address case, it could be complicated. For this reason, I am developing DAMON-based Operation Schemes[1]. It is designed to do the monitoring and optimization of specific regions fit in special monitoring result by DAMON itself. Nonetheless, current version of it supports only virtual address spaces. A support of physical address space from the feature will be another future work. If the user space really need to do that by itself, we could provide the physical address to virtual address mapping info in addition to the monitoring result in future. And, yes, we have so many TODO tasks that really necessary. I will eventually do all of those, but also concerning about my limited time. Nevertheless, I believe it would better to focus on the core of DAMON[2] for now and continue further TODO tasks after it is merged in the mainline, because maintainance of the code will be much easier and hopefully more developers could collaborate for the many TODO tasks. [1] https://lore.kernel.org/linux-mm/20200804142430.15384-1-sjpark@amazon.com/ [2] https://lore.kernel.org/linux-mm/20200817105137.19296-1-sjpark@amazon.com/ Thanks, SeongJae Park