From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D8F5C433E3 for ; Thu, 20 Aug 2020 15:44:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 705722086A for ; Thu, 20 Aug 2020 15:44:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TxIGJoGS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729281AbgHTPov (ORCPT ); Thu, 20 Aug 2020 11:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728209AbgHTPos (ORCPT ); Thu, 20 Aug 2020 11:44:48 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380CAC061386 for ; Thu, 20 Aug 2020 08:44:48 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id t23so2625311ljc.3 for ; Thu, 20 Aug 2020 08:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aW5D54Ks5bX7GTCPUNj/OhuX5CYhQx8WbzzDnGuedJk=; b=TxIGJoGSvER1kxH5GBxsgjNclU/AHsfEWRdVgil+xYIRkguO4qQMTt9DnDGU5jJOgy ogCuH/O85Igrb+7qvogcO8TLebRhFiMUvflPiN3DNoKb1coNIoBP0m2nvYjW7k0ZxBGX vw0GTxaHMuB3GeaQqRqQzKcE1xNc2dEJbI79H2tjq/EAlHrz3eSIexo0BLHo1DYtNg6X sRZ3T2aD9KQwcUdy7oeWWXxgVRVmnxLtQUkg19ZUgeU8YB4bdNSt5V6ME2c/QeUPjmOF Omd+pN5k1hP+EGsNGYyVto9WNbDs4wzBn6xY3Fdu/OByVHWyHuM+LNaWwejOVK4fmFjw u3ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aW5D54Ks5bX7GTCPUNj/OhuX5CYhQx8WbzzDnGuedJk=; b=jpmOHpTLjrO8ePkWnCxqXVGnDC9CkVboe+zaWQCvoE8K0W56c5RTrRphpNkLkm66eK ttkvHPi8QC9V108gHhK2cUeQwjsphpF0juLNlv728c5SUNkcJti3+DM7l9KxO9eMiu0p zEgZ8mIlp1usB+tJY+qYabdFQ69yIxvTVWLK/Uxp4pXXfSv56YauGSZfSfmVQ8xeuZGQ FIfx5CRY9GxwADN+dc07ZDsAta71qLIAv9eMQjBSlOHzXGriVaDVHn11aNwnt0yyOtsW vwQClecP0aRwwb1wDuc2d4A0f0ZATlnbXEnUpRHtGvtd6xSsr05AurEOb738mzFBb+aW cCkg== X-Gm-Message-State: AOAM530USfV/ciZixbMl91sQEEFDl1CI6GkyBsudZMaZ+fZQT3EEFA8f wj7Vf+3v0/lugZTC2TJLDwFsLXIK4iYVIX/THJuoUQ== X-Google-Smtp-Source: ABdhPJyOZc54KS+mHAonnQxVVG97p8XeDrNjnguZlqikAmyZwh9t7GuPdIbj3CDjTwWyvxCjtXg082HL/ahD1OPebpE= X-Received: by 2002:a05:651c:233:: with SMTP id z19mr1964269ljn.347.1597938286213; Thu, 20 Aug 2020 08:44:46 -0700 (PDT) MIME-Version: 1.0 References: <20200820071052.24271-1-sjpark@amazon.com> In-Reply-To: <20200820071052.24271-1-sjpark@amazon.com> From: Shakeel Butt Date: Thu, 20 Aug 2020 08:44:33 -0700 Message-ID: Subject: Re: [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring To: SeongJae Park Cc: SeongJae Park , Jonathan.Cameron@huawei.com, Andrea Arcangeli , acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendan.d.gregg@gmail.com, Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , David Hildenbrand , dwmw@amazon.com, "Du, Fan" , foersleo@amazon.de, Greg Thelen , Ian Rogers , jolsa@redhat.com, "Kirill A. Shutemov" , mark.rutland@arm.com, Mel Gorman , Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , rppt@kernel.org, sblbir@amazon.com, shuah@kernel.org, sj38.park@gmail.com, snu@amazon.de, Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , zgf574564920@gmail.com, linux-damon@amazon.com, Linux MM , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD8BEC433DF for ; Thu, 20 Aug 2020 15:44:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A3DE62075E for ; Thu, 20 Aug 2020 15:44:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TxIGJoGS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3DE62075E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2B7A78D0024; Thu, 20 Aug 2020 11:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 240998D0001; Thu, 20 Aug 2020 11:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 108C78D0024; Thu, 20 Aug 2020 11:44:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id EC6948D0001 for ; Thu, 20 Aug 2020 11:44:51 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9C35E180AD802 for ; Thu, 20 Aug 2020 15:44:51 +0000 (UTC) X-FDA: 77171369982.15.heart27_420b7a127031 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id A7A041814B0D4 for ; Thu, 20 Aug 2020 15:44:48 +0000 (UTC) X-HE-Tag: heart27_420b7a127031 X-Filterd-Recvd-Size: 6712 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 15:44:48 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id v4so2635317ljd.0 for ; Thu, 20 Aug 2020 08:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aW5D54Ks5bX7GTCPUNj/OhuX5CYhQx8WbzzDnGuedJk=; b=TxIGJoGSvER1kxH5GBxsgjNclU/AHsfEWRdVgil+xYIRkguO4qQMTt9DnDGU5jJOgy ogCuH/O85Igrb+7qvogcO8TLebRhFiMUvflPiN3DNoKb1coNIoBP0m2nvYjW7k0ZxBGX vw0GTxaHMuB3GeaQqRqQzKcE1xNc2dEJbI79H2tjq/EAlHrz3eSIexo0BLHo1DYtNg6X sRZ3T2aD9KQwcUdy7oeWWXxgVRVmnxLtQUkg19ZUgeU8YB4bdNSt5V6ME2c/QeUPjmOF Omd+pN5k1hP+EGsNGYyVto9WNbDs4wzBn6xY3Fdu/OByVHWyHuM+LNaWwejOVK4fmFjw u3ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aW5D54Ks5bX7GTCPUNj/OhuX5CYhQx8WbzzDnGuedJk=; b=oVx8AvJxj35iC3fD8lhffPu67ERk6ACQJd0ZkmZdOVPn52S577UUhdRuviUw9Fhlsg Ka2pYh7t4mgpq2phj+XPDAussUqZb7w3y2SyYpPaKTuIb1knKNIFJY+hZQBc59xIe7h8 BGns6aGNw5xCqEYoEF0XaBrhKw2vTjNeAGcXJQWMpBeaoZtfcoLWRO793/OjWYc9oeqp n/+DD3YpTVZ9d4bH10biIjFLYTZF4nzYH2PZ6Wrgjn7L9uVJ/xO/v9cFGmcFziZziobI nJdx12F1rMo/Z0CZJPlVm7Pxxs/++o6ZbbMCr/er5WPtuRCsQ8I003QL7FEXUAUvP4ut e3HQ== X-Gm-Message-State: AOAM532GyZrGK+EvGdUS4wmJlWM89vgRzICuWNclNIrXTvEH4gaakHZb e1Z/f6hZAStcSUUTyV0DfWWqAgLAav/qiIX04U5fbg== X-Google-Smtp-Source: ABdhPJyOZc54KS+mHAonnQxVVG97p8XeDrNjnguZlqikAmyZwh9t7GuPdIbj3CDjTwWyvxCjtXg082HL/ahD1OPebpE= X-Received: by 2002:a05:651c:233:: with SMTP id z19mr1964269ljn.347.1597938286213; Thu, 20 Aug 2020 08:44:46 -0700 (PDT) MIME-Version: 1.0 References: <20200820071052.24271-1-sjpark@amazon.com> In-Reply-To: <20200820071052.24271-1-sjpark@amazon.com> From: Shakeel Butt Date: Thu, 20 Aug 2020 08:44:33 -0700 Message-ID: Subject: Re: [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring To: SeongJae Park Cc: SeongJae Park , Jonathan.Cameron@huawei.com, Andrea Arcangeli , acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendan.d.gregg@gmail.com, Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , David Hildenbrand , dwmw@amazon.com, "Du, Fan" , foersleo@amazon.de, Greg Thelen , Ian Rogers , jolsa@redhat.com, "Kirill A. Shutemov" , mark.rutland@arm.com, Mel Gorman , Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , rppt@kernel.org, sblbir@amazon.com, shuah@kernel.org, sj38.park@gmail.com, snu@amazon.de, Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , zgf574564920@gmail.com, linux-damon@amazon.com, Linux MM , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A7A041814B0D4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: 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? 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?