Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp784421ybg; Wed, 10 Jun 2020 13:41:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpLyZtrAnjmE4ZgYzHIPeCcL4ZJalJfO0jjNIioVuUv+YsyYtEEfpABUvM2jVRW34V7E1l X-Received: by 2002:a17:906:da05:: with SMTP id fi5mr5303392ejb.95.1591821706445; Wed, 10 Jun 2020 13:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591821706; cv=none; d=google.com; s=arc-20160816; b=OZXobrVQuVdG9ObU0TT/hO4kbTlT+cUa/0VdXlg08cRz6tdqC2X6NouJceeO3ax2VL Kt+PYUBWiYG9cYWLOt8+ojT98R24cu/w4bvWYyDDKDhgX+3mG2iKCkpKW1pNez44jl8t EzLXB8dM8oucT94E+oCsjcuCX974FtesfuZEU+qcVp+H5SvQt94sRh/BTSMOXEKiu7Ej dbxWaMGgYgAkTm/RzDlnsX58uBai/Gz+LVGxgNx4N23+Nike3JHXA5skio0tLNIR3uLA t+WGt1TDnT09Ct1AEsAon3GAFsEJ8NlB4JyaxfHkH25J0t7VxkMwjXyga7NmiZXKv9Ns pTlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=liN5JyApF816eig8jyVWFWX64ihEA24InHG8G0A0itM=; b=L4IFAW8jdlWds3kKYpG/sU3QduzFgCgJx1bHG9BVdZG9OBbfE5iQZNrk9DNhcTtVoc 2NfqdDzN7ekW8ZTdIL8AZGT95lr/2ycQYBsAmsV7S2Td8QO0OUcBT217gmAWSJ+aKvPK BlLzCJb5CbobkTx0YDsBWNKHD3ZAW+amMWli+Rd7nnH257zVcJlLGTEDh4YKVVvd+gyL wS/vI/ajt56Xn64lJbKAL3snNXzElXgEzRyYIO5OikbjVXWZfI/bUiCSeCpghSTB7NoC K7W2ZiUARSTZw5O6kB7EfKuCZwUbxJp4d4N/E9++lJekcVmtSytje8hNzcAFiaINiQfM yAQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="I/DrW8SM"; 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 j28si380052edy.293.2020.06.10.13.41.22; Wed, 10 Jun 2020 13:41:46 -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="I/DrW8SM"; 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 S1726812AbgFJUg5 (ORCPT + 99 others); Wed, 10 Jun 2020 16:36:57 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:24613 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbgFJUgz (ORCPT ); Wed, 10 Jun 2020 16:36:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591821411; x=1623357411; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=liN5JyApF816eig8jyVWFWX64ihEA24InHG8G0A0itM=; b=I/DrW8SMyQ7toxLvnPyXd2TF1xr2EdmyOkNFNmtOTrKJdbe1Yd/wEWhg O2aMPaiH9Lbmdz1/oGtHuAiX0UiSFSq1K25qvuf0vtyV8WNTet5rVoY6i R9RbE8toDoonusT2SE0HZeK7UFMvzb/I05nL+g+ElDWfqzAC6McuWjaOH 8=; IronPort-SDR: myVHALjUDmmzFKOhBSaH0tEyovPT/K4nBY2QiudAG1DuWiPCvUJC5G/hyHFs7lGNgyg3gGoU9L 9u8a1bu9Cvbg== X-IronPort-AV: E=Sophos;i="5.73,497,1583193600"; d="scan'208";a="43119066" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-e34f1ddc.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 10 Jun 2020 20:36:48 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-e34f1ddc.us-east-1.amazon.com (Postfix) with ESMTPS id ED84DA2702; Wed, 10 Jun 2020 20:36:36 +0000 (UTC) Received: from EX13D07EUA004.ant.amazon.com (10.43.165.172) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Jun 2020 20:36:11 +0000 Received: from EX13MTAUEA002.ant.amazon.com (10.43.61.77) by EX13D07EUA004.ant.amazon.com (10.43.165.172) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Jun 2020 20:36:10 +0000 Received: from u908889d5e8f057.ant.amazon.com (10.1.212.33) by mail-relay.amazon.com (10.43.61.169) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 10 Jun 2020 20:36:01 +0000 Subject: Re: [PATCH v15 03/14] mm/damon: Implement region based sampling To: SeongJae Park , CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20200608114047.26589-1-sjpark@amazon.com> <20200608114047.26589-4-sjpark@amazon.com> From: Message-ID: Date: Wed, 10 Jun 2020 22:36:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200608114047.26589-4-sjpark@amazon.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gNi84LzIwIDE6NDAgUE0sIFNlb25nSmFlIFBhcmsgd3JvdGU6Cj4gRnJvbTogU2VvbmdKYWUg UGFyayA8c2pwYXJrQGFtYXpvbi5kZT4KPiAKPiBUaGlzIGNvbW1pdCBpbXBsZW1lbnRzIERBTU9O J3MgYmFzaWMgYWNjZXNzIGNoZWNrIGFuZCByZWdpb24gYmFzZWQKPiBzYW1wbGluZyBtZWNoYW5p c21zLiAgVGhpcyBjaGFuZ2Ugd291bGQgc2VlbXMgbWFrZSBubyBzZW5zZSwgbWFpbmx5Cj4gYmVj YXVzZSBpdCBpcyBvbmx5IGEgcGFydCBvZiB0aGUgREFNT04ncyBsb2dpY3MuICBGb2xsb3dpbmcg dHdvIGNvbW1pdHMKPiB3aWxsIG1ha2UgbW9yZSBzZW5zZS4KPiAKPiBCYXNpYyBBY2Nlc3MgQ2hl Y2sKPiAtLS0tLS0tLS0tLS0tLS0tLS0KPiAKPiBEQU1PTiBiYXNpY2FsbHkgcmVwb3J0cyB3aGF0 IHBhZ2VzIGFyZSBob3cgZnJlcXVlbnRseSBhY2Nlc3NlZC4gIE5vdGUKPiB0aGF0IHRoZSBmcmVx dWVuY3kgaXMgbm90IGFuIGFic29sdXRlIG51bWJlciBvZiBhY2Nlc3NlcywgYnV0IGEgcmVsYXRp dmUKPiBmcmVxdWVuY3kgYW1vbmcgdGhlIHBhZ2VzIG9mIHRoZSB0YXJnZXQgd29ya2xvYWRzLgo+ IAo+IFVzZXJzIGNhbiBjb250cm9sIHRoZSByZ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