Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1145139pxu; Fri, 27 Nov 2020 00:20:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyURGN9IUBYFWGJstJTm6Lu65NkkCjQeHv9BCQdqjWA57bVZiwWLq83ElbqTkgFmxy/21P3 X-Received: by 2002:a17:906:3daa:: with SMTP id y10mr6307135ejh.23.1606465257864; Fri, 27 Nov 2020 00:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606465257; cv=none; d=google.com; s=arc-20160816; b=eB61z19YUXZafiBbDNuVaSOCY94M+rg+yArK9aov7i5Y9KEqtadLc47q+7R8mBAc4P X+xsqOTK1zQw+/is0FwmrQssxOMdT4p9oDCOsjkY3mKV3SA6bX7muFO07/elKM7k3bAZ MzPNqqU94UFJF4GRODKPr2EOPHQGEK+RJ1veVTKNuZYkWAjaWqPnDZg6k/0wQnTBH+TW xX5QkQKt03S/qWGfNVPCzYjFnB7QJ5rSGURWTf9cwvMlJeXPRCCeOH0jrbcvY0/yNx48 Qs2kyUoy+Dh9IhxWFy5z802riKFgSN7BOrlRSWxZ2TGt1Z8bFZ/p4vVdq8By4WTJqX2l AzsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=wuAaV6r6w2/rFPIrtuYzgXuA5dvTc38BY0LFs0T2lz4=; b=x67SP4tBVFd7/EkhsdVVGSepC+OpVYgP8j53p5kUc8FAFmoHsYoLtmqZoce4mOGBr7 ZgdLr9GaWFp4ZzRL0orhhPIMiHmly/Kvi0uPM89PcLBqllP7dQ7Mlj9IFL0k784xgIkR RBkEz1BAZSVo7ca+CkOc+Gp5BMyC1M9qRoWbrMG03rJ5EWsEa4SH1x3CMtMpMF2ZcNuG mrCYEUw6VoeqL9f3WmwmG7uCOgzfXQ7dI20vmxws1eUAh9D8zrt24fhliP25IZP9U/rq 0CdDfjre/3OZUzZTft63QhhZsRkq7jAvoutJKVmc7dpL5/mpv5fgynddtPIwgbLO149A jdYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="fOC0/2hg"; 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 t23si4995162ejs.429.2020.11.27.00.20.35; Fri, 27 Nov 2020 00:20:57 -0800 (PST) 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="fOC0/2hg"; 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 S1731101AbgKZMNV (ORCPT + 99 others); Thu, 26 Nov 2020 07:13:21 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:18678 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389007AbgKZMNU (ORCPT ); Thu, 26 Nov 2020 07:13:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1606392800; x=1637928800; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=wuAaV6r6w2/rFPIrtuYzgXuA5dvTc38BY0LFs0T2lz4=; b=fOC0/2hgNZWu+U8ZSpi+SwfeIyO/e968pDhijpYQ0+9YQQ8iuW+XdhFL yQoz+ERfRpQDN9PuwzyOajxExkv6E68IJI1lATjwuTzW0R9Np6qJR/n63 H8zN9P6ant90wdFHU/MW1xvWR4UbwelIwHlyWxbI+H9tzZ6BWN6oA85/1 I=; X-IronPort-AV: E=Sophos;i="5.78,372,1599523200"; d="scan'208";a="65938514" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 26 Nov 2020 12:13:09 +0000 Received: from EX13D31EUA001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com (Postfix) with ESMTPS id 33FB7A1BD9; Thu, 26 Nov 2020 12:12:56 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.162.50) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Nov 2020 12:12:40 +0000 From: SeongJae Park To: Shakeel Butt CC: SeongJae Park , SeongJae Park , , Andrea Arcangeli , , , , , , Brendan Higgins , Qian Cai , Colin Ian King , Jonathan Corbet , "David Hildenbrand" , , Marco Elver , "Du, Fan" , , "Greg Thelen" , Ian Rogers , , "Kirill A. Shutemov" , Mark Rutland , Mel Gorman , Minchan Kim , Ingo Molnar , , "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , , Shuah Khan , , , Vlastimil Babka , Vladimir Davydov , Yang Shi , Huang Ying , , , Linux MM , , LKML Subject: Re: [PATCH v22 03/18] mm/damon: Adaptively adjust regions Date: Thu, 26 Nov 2020 13:12:26 +0100 Message-ID: <20201126121226.18883-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.162.50] X-ClientProxiedBy: EX13D15UWB003.ant.amazon.com (10.43.161.138) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Nov 2020 07:29:41 -0800 Shakeel Butt wrote: > On Tue, Oct 20, 2020 at 2:01 AM SeongJae Park wrote: > > > > From: SeongJae Park > > > > Even somehow the initial monitoring target regions are well constructed > > to fulfill the assumption (pages in same region have similar access > > frequencies), the data access pattern can be dynamically changed. This > > will result in low monitoring quality. To keep the assumption as much > > as possible, DAMON adaptively merges and splits each region based on > > their access frequency. > > > > For each ``aggregation interval``, it compares the access frequencies of > > adjacent regions and merges those if the frequency difference is small. > > Then, after it reports and clears the aggregated access frequency of > > each region, it splits each region into two or three regions if the > > total number of regions will not exceed the user-specified maximum > > number of regions after the split. > > > > In this way, DAMON provides its best-effort quality and minimal overhead > > while keeping the upper-bound overhead that users set. > > > > Signed-off-by: SeongJae Park > > Reviewed-by: Leonard Foerster > > The high level comment I have is that kdamond_[merge|split]_regions > should be part of the abstraction of the target instead of the damon > context. Agreed in a high level. Please refer to my answer to your second suggestion at https://lore.kernel.org/linux-mm/20201126115157.6888-1-sjpark@amazon.com/ Thanks, SeongJae Park