Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp582953ybz; Wed, 29 Apr 2020 05:51:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIhO9YCf3ZGmQnbnAlqef9VxJw9KyhE1Ft7mEXFAPgMS9ZdSCDaXsmoLgQdtJH/UrQQBvRo X-Received: by 2002:a05:6402:1d23:: with SMTP id dh3mr2271401edb.349.1588164669316; Wed, 29 Apr 2020 05:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588164669; cv=none; d=google.com; s=arc-20160816; b=XEHIFCN3Ue8G05AbB1sV5FoPfssrugMd4dQdvPZPZdEZXIyEFv4UT7Y5zWJhqao4z1 gzm9xk2OJ2qC2UEb+sb8Wl4UnQ/vPMzkqnB74LL5io6rB/eD/MNNctsNoRySTgp533sF DiAZmfXuIH0/oDm6PkGmzcUyvtO29h+Urj7pkaJzqG6E6oMngNrd2diBR/YUfujqYCYl 7YnDUb/37OB86P5ZYbIay0+VhDTajMQ48NTsHIvUJdqnfSqwanOziNFNJpZ0B1q9Gani oWVdZiHuF09rKFIheaWpuoaulN3aHyQG20V9w5SfsVxieoc9AjKVDz3uqKatndLRj7Jd YTbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=i9Ktdq6XJ1x8mbo3cpU31R9J0kNio43Zj46PLUO5qnM=; b=XCJnto3rcse9QBYnJ/sjqpxegtltBLtiegELOciITf7USkIN+qAdxlu9RHieBilxKw f9TS++A09955cSteT5/cALySY5cLYUAuFPX4wnd+znPmXSElqYRlCuMGD2MrUFvgA90z PUiZZdDzc+ktDMj8qQhquWk7gDbiDB/nqRG/OtMSouk3FP4lvdcqwhCOKMxpfTnD40T4 5WiKV/bHGjvK4YbiQQNXhG74AEaEVK9lcZUfYvsDcBGYr4Wfd/x4sFXzOUfn+KGGvDhA mb9Sy8k3SXYu45a0yHHJ587Ljm8mRBLI33XQRDXTComr4wlyadIvSHbBOYV6ZUWR2ZbX LttA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=c0FumvTP; 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 jx10si3700997ejb.150.2020.04.29.05.50.44; Wed, 29 Apr 2020 05:51:09 -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=c0FumvTP; 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 S1726949AbgD2MsY (ORCPT + 99 others); Wed, 29 Apr 2020 08:48:24 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:65089 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgD2MsY (ORCPT ); Wed, 29 Apr 2020 08:48:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1588164503; x=1619700503; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=i9Ktdq6XJ1x8mbo3cpU31R9J0kNio43Zj46PLUO5qnM=; b=c0FumvTPhKa2LQYzNCvxj6min3C2muyeB1w7R0M9ndkKuDbRG9pnEPmT bHrP1L9awvUwtgkIzQ7m1T04JQ+zslnhjlf8du1ALJBu0jLH26O7hvc+V u4IYwVg0PZoHtZOtnf7f/234llfWG95eVeDQj2KVlJ2RRJVOKezrxlmnC k=; IronPort-SDR: HqrxEXOd52d+L3H48YPZwpClFm1HTQaKrVXUEZRaVU5aQGSpTUVSJ4gHaJeX7GcqR7Y2XbBSqR eovNCj0yZZ1w== X-IronPort-AV: E=Sophos;i="5.73,332,1583193600"; d="scan'208";a="27958444" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-37fd6b3d.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 29 Apr 2020 12:48:23 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-37fd6b3d.us-east-1.amazon.com (Postfix) with ESMTPS id C2D532878F2; Wed, 29 Apr 2020 12:48:11 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Apr 2020 12:48:11 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.200) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Apr 2020 12:47:55 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v7 5/7] mm/damon-test: Add kunit test case for regions age accounting Date: Wed, 29 Apr 2020 14:45:38 +0200 Message-ID: <20200429124540.32232-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200429124540.32232-1-sjpark@amazon.com> References: <20200429124540.32232-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.200] X-ClientProxiedBy: EX13D06UWC004.ant.amazon.com (10.43.162.97) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park After merges of regions, each region should know their last shape in proper way to measure the changes from the last modification and reset the age if the changes are significant. This commit adds kunit test cases checking whether the regions are knowing their last shape properly after merges of regions. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- mm/damon-test.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/damon-test.h b/mm/damon-test.h index 439ffce783f6..780094deea05 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -551,6 +551,8 @@ static void damon_test_merge_regions_of(struct kunit *test) unsigned long saddrs[] = {0, 114, 130, 156, 170}; unsigned long eaddrs[] = {112, 130, 156, 170, 230}; + unsigned long lsa[] = {0, 114, 130, 156, 184}; + unsigned long lea[] = {100, 122, 156, 170, 230}; int i; t = damon_new_task(42); @@ -567,6 +569,9 @@ static void damon_test_merge_regions_of(struct kunit *test) r = __nth_region_of(t, i); KUNIT_EXPECT_EQ(test, r->vm_start, saddrs[i]); KUNIT_EXPECT_EQ(test, r->vm_end, eaddrs[i]); + KUNIT_EXPECT_EQ(test, r->last_vm_start, lsa[i]); + KUNIT_EXPECT_EQ(test, r->last_vm_end, lea[i]); + } damon_free_task(t); } -- 2.17.1