Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp318454ybg; Wed, 3 Jun 2020 01:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM+5byQboHJzdPby7Jy2P19BxJoma8Gvb4lvywMC/vtaVrWMgUNdocNWSqp8Vz0l/L170P X-Received: by 2002:a17:906:b7cd:: with SMTP id fy13mr27901260ejb.133.1591172699525; Wed, 03 Jun 2020 01:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591172699; cv=none; d=google.com; s=arc-20160816; b=innmC+1tvkf45Qbyj3Bswl0/1OKjI5lhBnbHJv0oXPbdTQKy4ivBfl+UtE88R1UwtO ga6Tms7Nh3vaflF/+pld+hKZ4PpF3z3XXX7TmVNyMCaLE/5Yp/DT6EQKtTc2tMpLpNdO ho/NIFmbKBLaDUXJnrkcXMk93mYnYNedm9nsLlACoEwPws0/pVS5W7EaKelIi8gpw8gQ umJXJpWGLixm4ZiY6FFTakRadGaBxWuMf1Chnv7NyoC3mOe+9aEV0qYVBrsevjpR4CYd 6HyEhIJ215O5AfFvGIsNlcswlisLH1XdQagtSOFYsoW8jJqECbL/M73l/BenejtB7C84 lZig== 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=ltepDip8GYGH7s3qWkk+SVUPzdNz3z4BCaQ5UJOGsY4=; b=ui3HdJOheSg4Z/HaG0HzehKTo9XLRruLvoEc5BvRI6/z+zaH8lrn/mI5h3Sdt1opS2 Gs4GjGhN1vdDY6hAvwhjp16S5PGydyzqMA5OO+wxnglVZFUSIjswc7mFAHV1nBljpdDH j0QOTuOWn601ZO2mhVEUmkJErmrVKYKM2MhE/GtuFTjYiNmTuKF+WTahPZpNar1KPtBQ b0cA2irUNYGA+rYsuIIOnhSzMj0Grh9IVUuILKnoO8VdNCyUIHNYi09VA5TUeWiphFmB UNYrXYUnI0sEUkMwURO9PL98wNriOg54ZdECrSUEBpN5h7GH4IUf+yOJ1S6lCQZ0lYCP rwbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=l4Bg5PpO; 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 w18si711709ejn.727.2020.06.03.01.24.35; Wed, 03 Jun 2020 01:24:59 -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=l4Bg5PpO; 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 S1726135AbgFCIW3 (ORCPT + 99 others); Wed, 3 Jun 2020 04:22:29 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:3688 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgFCIW2 (ORCPT ); Wed, 3 Jun 2020 04:22:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591172548; x=1622708548; h=from:to:cc:subject:date:message-id:in-reply-to; bh=ltepDip8GYGH7s3qWkk+SVUPzdNz3z4BCaQ5UJOGsY4=; b=l4Bg5PpOBsmTGqVUAxguiOUchaPHDyJALO52b0MpEcZ0fAI4lTtRquRm OHiira0PmQD4bQ6MrmWT0C/plaLFw39GSx2oR6gwgKudWDyZy3OFSva5j z7DpxoLLx2Jk3UwDvNLKL0mzsE5Lds+KwHjDxBwrmYkBIeEgoTkik+4wF c=; IronPort-SDR: EElwHaomUF4hKHGT9UT0OPvO30M5R1ERpO/Gy4Ud0OsEFwjpNQxd7g4OoONO0VbMKA/dYoGzoE ACZozbNH6gtQ== X-IronPort-AV: E=Sophos;i="5.73,467,1583193600"; d="scan'208";a="35503456" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 03 Jun 2020 08:22:12 +0000 Received: from uc85b765ebdd8595b4b67.ant.amazon.com (pdx2-ws-svc-lb17-vlan2.amazon.com [10.247.140.66]) by email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com (Postfix) with ESMTPS id B32C7A2897; Wed, 3 Jun 2020 08:22:08 +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 0538M6vl025816; Wed, 3 Jun 2020 10:22:06 +0200 Received: (from foersleo@localhost) by uc85b765ebdd8595b4b67.ant.amazon.com (8.15.2/8.15.2/Submit) id 0538M27b025751; Wed, 3 Jun 2020 10:22:02 +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, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 04/15] mm/damon: Adaptively adjust regions Date: Wed, 3 Jun 2020 10:21:58 +0200 Message-Id: <1591172518-25575-1-git-send-email-foersleo@amazon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20200602130125.20467-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-02T15:01:14+02:00 SeongJae Park wrote: > From: SeongJae Park > > At the beginning of the monitoring, DAMON constructs the initial regions > by evenly splitting the memory mapped address space of the process into > the user-specified minimal number of regions. In this initial state, > the assumption of the regions (pages in same region have similar access > frequencies) is normally not kept and thus the monitoring quality could > be low. 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 regions if the total number > of regions is smaller than the half of the user-specified maximum number > of regions. > > In this way, DAMON provides its best-effort quality and minimal overhead > while keeping the bounds users set for their trade-off. > > Signed-off-by: SeongJae Park Reviewed-by: Leonard Foerster