Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1178551ybt; Thu, 18 Jun 2020 02:27:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5FLYWzcGK/TmkKVZtJM9P/fUhe3qYmPh+dc2CkDftZ3yxTa9t8Xi69/RVxyOxNnfXqYeg X-Received: by 2002:a50:f297:: with SMTP id f23mr3130232edm.222.1592472441140; Thu, 18 Jun 2020 02:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592472441; cv=none; d=google.com; s=arc-20160816; b=BaNh34rH491CLJSZB7e/ZFdjuR2JrxcXf36+b0Jpc/RD07MJ0vsOl4Bj9+O5o3qYWi 4lTlbhm30yMpwP3qcyMu5fsP4Km/ZKARIAysNAUNhguRcBVHUWIKJxHBasOXs7cTUhYA TUWOnwT1MZnvzO1LGniGRy+4AMIFey2QIxKUE2oVfAcwe2kV+hdFMB8deDkeqBRxbLGV j/0U3mKSyv+GeZ4Jn+EkDYXc4+NYySdIEgsqQZRST8VH9ApXFNO9KcYXTGSg37qY+K+V sZMojhdtr5tUVaQyA7m90P0XfTjDmFE5PNJtgZ6ZjVjxFnjyWXMZqgm+yq7QtVdxTWlT QGHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:dkim-signature; bh=mwc39JT7lEE4KuagndIAD1fHOgAiEu1k9Z0qdaYumW8=; b=IKERRd0EcG/6npnYv+lo+yyCRX50qfbjWViev6jbgrO/bUyl7zF3lPqVRWvC/eGaxd qiGCNPwBh5TwDXnxOCVDMkFruBNtwBW28gnL4gE0RHbFJekixCIhNx1q9soTsywc+1VD 3TXUx0HlQftMJH7pFpmWniy0k0zaRh3yK44cBN9mooDreqdv3BAHo9229aij1q/beAb3 1lXaGS3i0sazWkeAbI1n3ikuSnEVKm/Skvv9Ghs2bB7w74ldWu5ggqbSi2KuKLtMgbXt JafBtjShRaBQI2czWOJk2cIXxXVwSsxu3O6o28Znu4heiS+gI6ztIzRYTZXxD8S1fzMk 3JOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=pBeoWm6R; 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 h1si1622109edq.86.2020.06.18.02.26.58; Thu, 18 Jun 2020 02:27:21 -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=pBeoWm6R; 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 S1729124AbgFRJYD (ORCPT + 99 others); Thu, 18 Jun 2020 05:24:03 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:8458 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbgFRJX6 (ORCPT ); Thu, 18 Jun 2020 05:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1592472238; x=1624008238; h=from:to:cc:subject:date:message-id:in-reply-to; bh=mwc39JT7lEE4KuagndIAD1fHOgAiEu1k9Z0qdaYumW8=; b=pBeoWm6R8k8LofQFIM/BxETjO8MH+GbZXQcLWQOOlBfVX3V/Wshw9uRu FaS5xxjnzp/qPDIfMgIgyJinJBpAf4QkXbqmWqXI+kAXLaf1Y+C0xIkbo 3OEMpmcZGp1nSZOSa9UKvBA7HHXwEpO2r7O/8frqPV6u0OkMAHkiO0/dP 4=; IronPort-SDR: 0k3bnbnOOC0ibSwUWEaAqbTA//k6JgCWBRROlxjeVKPOkcJsF5nR8ujzxI8+lOF23Mb6zLeAqQ oLi3j0MLsW0w== X-IronPort-AV: E=Sophos;i="5.73,526,1583193600"; d="scan'208";a="36992751" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 18 Jun 2020 09:23:55 +0000 Received: from uc85b765ebdd8595b4b67.ant.amazon.com (iad7-ws-svc-lb50-vlan3.amazon.com [10.0.93.214]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id 602E7A2134; Thu, 18 Jun 2020 09:23:43 +0000 (UTC) Received: from uc85b765ebdd8595b4b67.ant.amazon.com (localhost [127.0.0.1]) by uc85b765ebdd8595b4b67.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id 05I9NeHI022756; Thu, 18 Jun 2020 11:23:40 +0200 Received: (from foersleo@localhost) by uc85b765ebdd8595b4b67.ant.amazon.com (8.15.2/8.15.2/Submit) id 05I9Ndau022754; Thu, 18 Jun 2020 11:23:39 +0200 From: Leonard Foerster To: SeongJae Park Cc: akpm@linux-foundation.org, SeongJae Park , Jonathan.Cameron@Huawei.com, aarcange@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendan.d.gregg@gmail.com, brendanhiggins@google.com, cai@lca.pw, colin.king@canonical.com, corbet@lwn.net, dwmw@amazon.com, foersleo@amazon.de, irogers@google.com, jolsa@redhat.com, kirill@shutemov.name, mark.rutland@arm.com, mgorman@suse.de, minchan@kernel.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, rdunlap@infradead.org, riel@surriel.com, rientjes@google.com, rostedt@goodmis.org, sblbir@amazon.com, shakeelb@google.com, shuah@kernel.org, sj38.park@gmail.com, snu@amazon.de, vbabka@suse.cz, vdavydov.dev@gmail.com, yang.shi@linux.alibaba.com, ying.huang@intel.com, david@redhat.com, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v16 04/14] mm/damon: Adaptively adjust regions Date: Thu, 18 Jun 2020 11:23:38 +0200 Message-Id: <1592472218-22708-1-git-send-email-foersleo@amazon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20200615161927.12637-5-sjpark@amazon.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-15T18:19:17+02:00 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. > > 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 third regions of random > size, if the total number of regions after the splits wouldn't exceed > the user-specified maximum number of regions. > > In this way, DAMON provides its best-effort quality and minimal overhead > while keeping the overhead bound. > > Signed-off-by: SeongJae Park > --- Reviewed-by: Leonard Foerster