Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp374574ybh; Thu, 12 Mar 2020 03:45:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu987ekmXS8R6tfD7QB6NwHE+RoibG3U6WnD2bb62mgwZ6NIzWUPLN9g+Z9wOyqQjtc05NF X-Received: by 2002:aca:cf87:: with SMTP id f129mr1997399oig.109.1584009917431; Thu, 12 Mar 2020 03:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584009917; cv=none; d=google.com; s=arc-20160816; b=ZFxNRbMW8nR5BGVtDwGpVGuu1pQq1oFtqDIDAKVDFXQa5gKU0vEEGlblpEWa1mUYmZ I8hQUQB71+zTuIZg9owYZsJUVE1fFyVW3HcEvvSkNxDfftb/I/tBDYqLwrl2+u0jI6iK fqHOclue/N664ewdTHNxrSrF/GiWELBy4QNde8VhE5K+Q94+aCWBrg+zNcOap3kJAVjf /fHAmXepEcdP2V0MsGlZO+4i/9MTcKFmTbB/2XqTgm13PanNDgzrk1+w1Uj3tLJzSJOx LiL03jswZw93hmSJUvKMjRMbN96kee9izLssP9t2hhMDbBZRNRozfA9hhP+GDJ4QdVsk YloA== 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:ironport-sdr:dkim-signature; bh=JjVUVkyITKh6OnXxlF9voS+7ECWo+oagHMISZeb68n4=; b=jgaMG1rGulxeDK8T2mhczVynNFetpnokbdO45Pp/qwy2c6AkjS7RPIZuQRCdMj4dgl 4eJLsJ1Ea5jX2qEFFreevAttU/IDZ3xgQ/y6yNZrSiYVjN5YBmHZj92jg7QEgkQ1eEeg QIpNIRqvLHefqgKkdHsWrq13X4lBAzJK/VrYWPsuw1XPoxhan7vbdfqTykzAbhf3v8fg Kr5VNyEaEUuj+1N7d3SsrMSJi/L7fQK4sAtcak/VL570iZJt66jPgTDKdCBo9T7a3puU xDOQcUmp4+z2mR0oykmPG8nTNtFJ00O9YtrdrhJIZbCw1b0w3bzOvH8d35oIneTlMEF4 jgQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=VWA7Nib7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a205si2418576oif.159.2020.03.12.03.45.04; Thu, 12 Mar 2020 03:45:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=VWA7Nib7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726964AbgCLKoe (ORCPT + 99 others); Thu, 12 Mar 2020 06:44:34 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:45611 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgCLKoe (ORCPT ); Thu, 12 Mar 2020 06:44:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1584009874; x=1615545874; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=JjVUVkyITKh6OnXxlF9voS+7ECWo+oagHMISZeb68n4=; b=VWA7Nib7v5txFk4Ebznxsd5t/8sX3UDrHhinTW/VM3cXXKjmlvBBDAO1 sJgXHh6l1nm9HZWMc3ittp4WBzrzh02qJOu2JpSrmy8qzsEc3OIWnS4A+ KcPZu2JWLl4ZNtpyMfMT9MaQ4xKxcxnGLvxyKhD1i50AJQw9m5878r8Es k=; IronPort-SDR: /Fi5fDHbdGgFaeEVjGxuBCgt3uvjHvA06aECjECSM9gV2TCJT98Kim5T9TGOmaz7BBCuUl7Wyk oi8Pwii65PZA== X-IronPort-AV: E=Sophos;i="5.70,544,1574121600"; d="scan'208";a="20742458" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-37fd6b3d.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 12 Mar 2020 10:44:22 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-37fd6b3d.us-east-1.amazon.com (Postfix) with ESMTPS id E50F32820B7; Thu, 12 Mar 2020 10:44:19 +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.1236.3; Thu, 12 Mar 2020 10:44:19 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.47) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Mar 2020 10:44:06 +0000 From: SeongJae Park To: SeongJae Park CC: Shakeel Butt , Andrew Morton , SeongJae Park , "Andrea Arcangeli" , Yang Shi , , , , , , Qian Cai , Colin Ian King , Jonathan Corbet , , , "Kirill A. Shutemov" , , Mel Gorman , Minchan Kim , Ingo Molnar , , , Randy Dunlap , David Rientjes , Steven Rostedt , , , "Vlastimil Babka" , Vladimir Davydov , Linux MM , , LKML Subject: Re: Re: Re: [PATCH v6 00/14] Introduce Data Access MONitor (DAMON) Date: Thu, 12 Mar 2020 11:43:45 +0100 Message-ID: <20200312104345.10032-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200312100759.20502-1-sjpark@amazon.com> (raw) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.47] X-ClientProxiedBy: EX13D16UWB001.ant.amazon.com (10.43.161.17) 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, 12 Mar 2020 11:07:59 +0100 SeongJae Park wrote: > On Tue, 10 Mar 2020 10:21:34 -0700 Shakeel Butt wrote: > > > On Mon, Feb 24, 2020 at 4:31 AM SeongJae Park wrote: > > > > > > From: SeongJae Park > > > > > > Introduction > > > ============ > > > [...] > > > > I do want to question the actual motivation of the design followed by this work. > > > > With the already present Page Idle Tracking feature in the kernel, I > > can envision that the region sampling and adaptive region adjustments > > can be done in the user space. Due to sampling, the additional > > overhead will be very small and configurable. > > > > Additionally the proposed mechanism has inherent assumption of the > > presence of spatial locality (for virtual memory) in the monitored > > processes which is very workload dependent. > > > > Given that the the same mechanism can be implemented in the user space > > within tolerable overhead and is workload dependent, why it should be > > done in the kernel? What exactly is the advantage of implementing this > > in kernel? > > First of all, DAMON is not for only user space processes, but also for kernel > space core mechanisms. Many of the core mechanisms will be able to use DAMON > for access pattern based optimizations, with light overhead and reasonable > accuracy. > > Implementing DAMON in user space is of course possible, but it will be > inefficient. Using it from kernel space would make no sense, and it would > incur unnecessarily frequent kernel-user context switches, which is very > expensive nowadays. Forgot mentioning about the spatial locality. Yes, it is workload dependant, but still pervasive in many case. Also, many core mechanisms in kernel such as read-ahead or LRU are already using some similar assumptions. If it is so problematic, you could set the maximum number of regions to the number of pages in the system so that each region monitors each page. Thanks, SeongJae Park > > > Thanks, > SeongJae Park > > > > > > thanks, > > Shakeel >