Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4784455pxj; Tue, 22 Jun 2021 08:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzskzD2anMmifplgvSfmSQrsqtyw0ECgoUsn40bjMLoPYvxuJ9MA4VwYjGw8knE/DqwaxEG X-Received: by 2002:a92:6610:: with SMTP id a16mr2878629ilc.124.1624374044521; Tue, 22 Jun 2021 08:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624374044; cv=none; d=google.com; s=arc-20160816; b=vT6g6BgwDhelEcLlQKgcvYO9VtrCbCB0fwUQAbW0XO9A0ySoANoru5qti/C2nZRMOo Pj1GK0CVSotXAlrpEqGGkgfYpf0aQJmrzeONEOmJXF4iMjt8eRzh2XEQLdWTmmxuv1Pg ubErkU4HvT1CUjDDXtQijJ1BAvjASFbXEAQj9UkWEf5Z+8oPrFLp07eSHizJOcMSLObR 9bQIpDowwSXFhiURHBzun1bO2AxTFm5uA/clLLnjTncB+E53xLvXtXqucXOTGMHtmRrg qPJj0VCmXMku7lN9L38H1BjNptdinAevn7lXZ7IRWokC1P0tNUAfCXQAeyQbUIia6cnZ Rb7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RA8ZD9ClukMzIKl1MArz2ae3thSxvhEA0gqsTc1XYss=; b=BzhPGh+w1b66aN8uN/JzeiBReM3XughXWQa1vELifQu7xw1wkNSzpK2r9r3024U4pn meCrA2PqvakVIPjehLK5VNgw1J47CgZZN2NFHlokfRR9i/1KfeLfELxjtwWs4HBi/dB3 dQpbhLaqcKdz2KpxHYXA4PmYaIRnlkTLGAubQ7DNgvJOA+0Da5We4E7sGT8n2gw9eYmq 9EL/Q5WaGaBPa5PWb8pgG7Ib0kA9ZfviSzjlQmLFgSGG+fKRxKojyt9j8qMDVP9iKeGk 0kzJ9eBDCAi8KkyuLxf7HYPsptDl788lJUO+BQdwl6zyJpFBkm+MnFXAtSnCjG2q0/6b bXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Pb4LQYmN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si24968115jat.74.2021.06.22.08.00.31; Tue, 22 Jun 2021 08:00:44 -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=@google.com header.s=20161025 header.b=Pb4LQYmN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231936AbhFVPBu (ORCPT + 99 others); Tue, 22 Jun 2021 11:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232097AbhFVPBs (ORCPT ); Tue, 22 Jun 2021 11:01:48 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F28C061767 for ; Tue, 22 Jun 2021 07:59:32 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id c11so30572621ljd.6 for ; Tue, 22 Jun 2021 07:59:32 -0700 (PDT) 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=RA8ZD9ClukMzIKl1MArz2ae3thSxvhEA0gqsTc1XYss=; b=Pb4LQYmNj3prWXaEvsu8+rvfYImNKOOFVO+YElWuhVGmGRuzjKH3ziJIRpyoScfWkq CtFTKrqB7bLWr3dbBYb/lObqKFZtynQCNjOKG4XgFCSzPIuj8Cq3KKhd3TmrtlHlqgED SafREWJtEpmXpAzkZuiZx9uJG1MHLKvv0RhzehuvcKx1aEcAfMsYsULjKYqMLOkFXgQ+ SXieBM52oa/d16NaRVwpOaypC3AyhGlXY8ya/3N0yFfVohmHUFpNW/6GvNFYew3hCdVj esSl1xYrpRwRjF6yq543gA9qCZrqpYjO7GGiGfzFegaccFxdLq9RKHxf51AdT9+N4tP+ ffYA== 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=RA8ZD9ClukMzIKl1MArz2ae3thSxvhEA0gqsTc1XYss=; b=Lzp1pxyR8srO9ep3YW35r7/G9KdCLkow39ymNYcTmdPkZ7MRKpSaEzuSHzoybQbp4q 7B7eJk2zhUMZjnULFlOqFXuC+S6AtxlMm1DMg74ZW6bQ8Jbadpm6ZPyFMBe5y/d2ewS6 dUbZu9ycwVpGe87OucMFXYOm9ZDQ3fn34egSkXS4zjP7xR2KDngxdmxXt9ZPPZefi9IG cnvD0EpV4KkerrXTFgXN1Wd+zrp5ou9W3/MpbCLke34UZfcpdmvtEpJ6wN8ejklqi/iY dYBLzbMNnO5362XQS9VGjqHYr8CD/apll8h5x0iC6r0UruXJwsiemjIkwEsPFuCwETd1 gxCw== X-Gm-Message-State: AOAM5311E9cTWUUBURWya6oTC4t0am7FNICEQY1Vf0XzK+Taxf7SJapv HDjkFELiFobwFJfKc3f4VGd4X/Su9iZQS+PgUTwl0A== X-Received: by 2002:a05:651c:49d:: with SMTP id s29mr3703265ljc.279.1624373970420; Tue, 22 Jun 2021 07:59:30 -0700 (PDT) MIME-Version: 1.0 References: <20210621083108.17589-1-sj38.park@gmail.com> <20210621083108.17589-3-sj38.park@gmail.com> In-Reply-To: <20210621083108.17589-3-sj38.park@gmail.com> From: Shakeel Butt Date: Tue, 22 Jun 2021 07:59:19 -0700 Message-ID: Subject: Re: [PATCH v31 02/13] mm/damon/core: Implement region-based sampling To: SeongJae Park Cc: Andrew Morton , SeongJae Park , Jonathan.Cameron@huawei.com, acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, Brendan Higgins , Jonathan Corbet , David Hildenbrand , dwmw@amazon.com, Marco Elver , "Du, Fan" , foersleo@amazon.de, greg@kroah.com, Greg Thelen , guoju.fgj@alibaba-inc.com, jgowans@amazon.com, Mel Gorman , mheyne@amazon.de, Minchan Kim , Ingo Molnar , namhyung@kernel.org, "Peter Zijlstra (Intel)" , Rik van Riel , David Rientjes , Steven Rostedt , Mike Rapoport , Shuah Khan , sieberf@amazon.com, snu@zelle79.org, Vlastimil Babka , Vladimir Davydov , zgf574564920@gmail.com, linux-damon@amazon.com, Linux MM , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 1:31 AM SeongJae Park wrote: > > From: SeongJae Park > > To avoid the unbounded increase of the overhead, DAMON groups adjacent > pages that are assumed to have the same access frequencies into a > region. As long as the assumption (pages in a region have the same > access frequencies) is kept, only one page in the region is required to > be checked. Thus, for each ``sampling interval``, > > 1. the 'prepare_access_checks' primitive picks one page in each region, > 2. waits for one ``sampling interval``, > 3. checks whether the page is accessed meanwhile, and > 4. increases the access count of the region if so. > > Therefore, the monitoring overhead is controllable by adjusting the > number of regions. DAMON allows both the underlying primitives and user > callbacks to adjust regions for the trade-off. In other words, this > commit makes DAMON to use not only time-based sampling but also > space-based sampling. > > This scheme, however, cannot preserve the quality of the output if the > assumption is not guaranteed. Next commit will address this problem. > > Signed-off-by: SeongJae Park > Reviewed-by: Leonard Foerster > Reviewed-by: Fernand Sieber Acked-by: Shakeel Butt