Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4554924pxj; Tue, 25 May 2021 10:32:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6eeWo5kETgV3/1rA+uIXv4Q2DV318Ai3jhGERVsEYwM05KKEVF0oH21DbeNh8VuaRjNCT X-Received: by 2002:a17:906:6009:: with SMTP id o9mr17562159ejj.204.1621963955784; Tue, 25 May 2021 10:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621963955; cv=none; d=google.com; s=arc-20160816; b=0zNghE8Dp74Q+uvj4BqLV47z/kF8l6DvlowCzuPbs+K6foqavG634Vo1QKqDCCtowX MwdHkphraX6KoeW8lY9c4vEuEosIj3xjaUu7iIUxlXowM87J3PWTVhtCYWX5FnwiZJ4b /LIzITmkrr9S3QGjaw58peLIIAVUyJf8OYpJjWMLmzYIkGFc/xZOfmmrqMGQlCFkDUDN e0oKwGtg3gQtQhvt7tiuyp1GZg880tfmh9r5dwbKwO7aRB/EwCAAMzQtymYLjNcAkgxG wv+crxzGRP45jtrgMdXDZrLdXJgr9WoBcaHvKh5S1uJny+i5rpdoizArk1Y7CDG9FWZq 3Cwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:subject :references:cc:to:dkim-signature; bh=yTek0pizCvLcTlNuueaRKn+sp3Yn2EKx4lOHoX8AyXg=; b=fDdZj8pohPkh/g/as8y+Kze5eun/ZNijq7K186Emzw1SKaaar5rBw36eUOPDqS0GXi TIQX8dnjvvJk4JO+Ygn1q7LIAdT1Qpnc4ly1u76S73RkFWAulpMEf4TVU1NU5NxTIyY2 DN2VVyj/U3NdSJDBREzCIeFTYwloVKZ4TP28RVtM6GcRZvpy54gOEwh1pkQE5UZ+1oMV bCXgG+gQoAga2gVnBU1/jMeeV2ZKvHo71avdZgpW8E93xNwOiU5+MJ/XmnU6Nq00HYqb 15o5c6+WdMKu5zsD2sST7CkKAhnQjPkFaHOsti1ZKOE40sjOKtth5uF9aM0BPfIc9Sh1 30+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=jHiYF7Mt; 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 t22si7931486edd.420.2021.05.25.10.32.12; Tue, 25 May 2021 10:32:35 -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=jHiYF7Mt; 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 S232746AbhEYPT5 (ORCPT + 99 others); Tue, 25 May 2021 11:19:57 -0400 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]:25083 "EHLO smtp-fw-9103.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232656AbhEYPTA (ORCPT ); Tue, 25 May 2021 11:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1621955850; x=1653491850; h=to:cc:references:subject:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=yTek0pizCvLcTlNuueaRKn+sp3Yn2EKx4lOHoX8AyXg=; b=jHiYF7Mt1ezN+EezA3s2X3DKHCnpoo4QxFxlHXSk4ZyEr46Uskaf1NNC iIUy8xnGUo/IyOqpDdW378nxXCTyojFIUJ5EdvPnzTJjgDD2wiDtBcZhU /vp/IDQn37lJQOiAl497vEbRKkfEYQDaEEj9//fwMdn7F63tGcpeCq25O g=; X-IronPort-AV: E=Sophos;i="5.82,328,1613433600"; d="scan'208";a="934958672" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-2b-c7131dcf.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP; 25 May 2021 15:17:23 +0000 Received: from EX13D31EUA003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-c7131dcf.us-west-2.amazon.com (Postfix) with ESMTPS id 5731EA1C5D; Tue, 25 May 2021 15:17:21 +0000 (UTC) Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D31EUA003.ant.amazon.com (10.43.165.95) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 25 May 2021 15:17:19 +0000 Received: from u8803c614af8f5a.ant.amazon.com (172.31.190.190) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Tue, 25 May 2021 15:17:07 +0000 To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20210520075629.4332-4-sj38.park@gmail.com> Subject: Re: [PATCH v29 03/13] mm/damon: Adaptively adjust regions From: Message-ID: <1b30265d-7440-1c94-f625-0087215433ee@amazon.com> Date: Tue, 25 May 2021 17:17:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210520075629.4332-4-sj38.park@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi SeongJae, The code looks good. Some questions for this patch: The region merge threshold is computed on the access diff. Should the diff threshold be exponential as diffs in low number of access are likely to be more important? I.e if the threshold is 5, a region A with 0 accesses will be merged with a region B with 4 accesses (diff=4), but a region C with 50 access won't be merged with a region D with 60 accesses (diff=10), however it seems to me that keeping a good granularity between A and B is more important than between C and D for FPR. What do you think? When the number of regions is less than half max region, region split kicks in and doubles the number of region. This means that the number of region will grow close to max region, then slowly decay as region merges, until it reaches half max regions, then double again. This seems to create a non-uniform region number distribution over time, with large cycles. Also we do a lot of work when we double and no work otherwise. Not sure what's the impact on measurement quality but intuitively seems like keeping the number of regions constant over time would yield more consistent metrics? How about we rather always split regions at each iteration, and for each region we give a split probability? Kind regards, --Fernand