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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham 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 384A0C56202 for ; Wed, 25 Nov 2020 15:29:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A08EC208CA for ; Wed, 25 Nov 2020 15:29:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HDVu0Syp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A08EC208CA 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 0728D6B0078; Wed, 25 Nov 2020 10:29:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 022CE6B007B; Wed, 25 Nov 2020 10:29:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E521D6B007E; Wed, 25 Nov 2020 10:29:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id CC03A6B0078 for ; Wed, 25 Nov 2020 10:29:54 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9364D8249980 for ; Wed, 25 Nov 2020 15:29:54 +0000 (UTC) X-FDA: 77523325908.16.blood08_4d0c34627377 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 6E3D8100E6903 for ; Wed, 25 Nov 2020 15:29:54 +0000 (UTC) X-HE-Tag: blood08_4d0c34627377 X-Filterd-Recvd-Size: 5340 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 15:29:53 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id d8so3727996lfa.1 for ; Wed, 25 Nov 2020 07:29:53 -0800 (PST) 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=xQqMteze+xCEHenPxthBOcsc/0tSfwlYlu1DqoC4HPs=; b=HDVu0SypUkrIgHq8Lxae6Be+CHBAkJmeBVmQ+herklMZWndUiYC8kMvy8Q6IAlaiGL UtYPndNlAzpDW/qVIl/oySemQRx0RhBQSdpniMuQ9w6UZWBwH8qCpY+VcXlj+2IMMBUV Ij/YRDh+SLKR/PeJ3IcLiRriCfMXSZeYulfuwycCVrjDIFvqoC96hG1To++cN69AfztD CYR+CklbRvZXkxHMGASiN0d/X96QnSMupdlDimuo3r4Vs52Pn5CUrgrpDSacBnFgmtmc Kkjk+rP/0VLT178E31JGhUaAg58LQlz5I7xBYGuHr8EsqKJsldnoK8Wv6Yz96ro1GmpC Song== 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=xQqMteze+xCEHenPxthBOcsc/0tSfwlYlu1DqoC4HPs=; b=SgNu0iE2g6v7Rexsgm0cvULi+O/L96sfcP/sYeyBeoOiNNzAnRsPaYhwib+QFanz/K k0LbzOFR3tq59m7RZcEkUtPH8jXkt1qYaJiYwqIFZlt1W+kvo+ObDgJ6SLBpPzYoXWMh TAdK3XIwOV3jyOR/qYZEak3s1jjLjRI+9baK2FEDasuWPslD0YiZTfNKqP4cMZ1Z4jN2 EHGQO9aC0XACUzzPigikkx2xapuBtNbA1xAP/zbeIKVs3LZOdwlWA+h0MHXU5OGfyQ2K j1dBFLnWzXT/ZtC74HjC7GwOaq8DEPtrlr4lenMUTaDiP4P+e5IYQZnPuHNFpatgWoGY Fx0A== X-Gm-Message-State: AOAM533je8fKMbs2QkYxz0eYhIguQ/qQo6Rpu/BK8Z8iM09Bjrvc4y9b OkNosXAUp81Xh6tzozde0ur7AA4l7lOoWdJbls1GKQ== X-Google-Smtp-Source: ABdhPJx85SPYIbloEx1FWJOrMCYVt4KwN1kTSlFJCN8071jaUDxsqRIq/NSp0TvyLXUzcHPWGeF46kjbfQryo9a5bFM= X-Received: by 2002:a19:be4a:: with SMTP id o71mr1491208lff.494.1606318192153; Wed, 25 Nov 2020 07:29:52 -0800 (PST) MIME-Version: 1.0 References: <20201020085940.13875-1-sjpark@amazon.com> <20201020085940.13875-4-sjpark@amazon.com> In-Reply-To: <20201020085940.13875-4-sjpark@amazon.com> From: Shakeel Butt Date: Wed, 25 Nov 2020 07:29:41 -0800 Message-ID: Subject: Re: [PATCH v22 03/18] mm/damon: Adaptively adjust regions To: SeongJae Park Cc: Andrew Morton , 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, Marco Elver , "Du, Fan" , foersleo@amazon.de, Greg Thelen , Ian Rogers , jolsa@redhat.com, "Kirill A. Shutemov" , Mark Rutland , Mel Gorman , Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Randy Dunlap , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , sblbir@amazon.com, Shuah Khan , 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-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 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.