Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2386445ybb; Mon, 30 Mar 2020 05:17:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtfinBkgDec/Tywz4eHfPUlWy9kpbUsUwtX5ZeJ4ZcdDzOzITsx5hFv5EDWpFDCRZZX3fCv X-Received: by 2002:a9d:69ca:: with SMTP id v10mr8458890oto.64.1585570655438; Mon, 30 Mar 2020 05:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585570655; cv=none; d=google.com; s=arc-20160816; b=L42zb9/GJxY55XSh2R4SYoE6UH9k2wJZ9ScizOKVPKkglhCF+IzQkBJd59AvdXFVf5 b8Od6PVqxu2PETHE1BzRNO7UXVJQKRHao6zUWRU/UJuISIysAvWKgPoLzRSks1fD1kCZ V1WwSC3sVx9jAEAlseuRkjJ0mNdEvpLJgQhFvZGkLNyyPcjs49a5il9XUEG/ud8If9W2 v9SRMW7tEQ4RhVQ801KtvILRwL9uESHEIqSkESdai4lxaSal5xDwc4wdG7weaRlsCNW1 VLoaS313SXxLJKfKQVCYPPPUxL6uQxH7hP9S8bjIi9p/+Q/4TLbv9encoIMbPnZeLYWb UraA== 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=X7XZgTBG3r8ae/hVZRlfEM88z2uthMQbepVKl7zl3ag=; b=SW1L3qV5XdSZS8C3Q1But1fV3Yl5OeI0llHLBlWJoDSY9iRH5yl/2ut8Q4r6gAyHvZ 2MtaDoed7g3x+dLcleMYuXYcOrL6XHZPY/cEMR3UNApjjpTZq7pKSBgiIZAq1q+VxQYl eiLWuBCNt3NYYjJD+mM6dWq7gmJ5xxMDBiiGAqATq840gr+g7pqj6uqTWS35QiiY5FIC VkTh5ZFQQqtPlVe39S+/Q2GXNevpwi9Ys3/ZhXtp6fRERN25XV0DkULYhLqZl9+JcKhz 1LzJlrY45RLMmSJeIxIP8o8X88VBSAHhBDILa2AeDMJnunjYnRF2RzEqkSJJrIQFO2FW 5zRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=fetqkCZL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u125si5332321oie.52.2020.03.30.05.17.16; Mon, 30 Mar 2020 05:17:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=fetqkCZL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730015AbgC3Lxe (ORCPT + 99 others); Mon, 30 Mar 2020 07:53:34 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:9922 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728764AbgC3Lxe (ORCPT ); Mon, 30 Mar 2020 07:53:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585569214; x=1617105214; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=X7XZgTBG3r8ae/hVZRlfEM88z2uthMQbepVKl7zl3ag=; b=fetqkCZLGBPpG8kKNFGIytNHtE9vS9DIZ6osj712Iw/DTfmtJ7o66G+V JsrR/GWs9n+HXCJ6sJkB/6s/Ux5kc8O7OUl5e7GdHBQqgb6p8dB+xnGqC DfpZO2zY2BmgTgPr4iYVtZFnUe1gICDcuian/9E3MtcHQfsk7mnsf06Qp k=; IronPort-SDR: Fju6uQ6d5Mf51ryyZ4YfNFms8Kav+dx2SxD5EnQeZ5qDARrjBDJpAa6drwWwSqqRq4SgUNU25m MmXQxdqtJQeQ== X-IronPort-AV: E=Sophos;i="5.72,324,1580774400"; d="scan'208";a="25842625" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 30 Mar 2020 11:53:31 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com (Postfix) with ESMTPS id 7F6CDA2BC8; Mon, 30 Mar 2020 11:53:19 +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.1236.3; Mon, 30 Mar 2020 11:53:18 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.134) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Mar 2020 11:53:04 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v5 5/7] mm/damon-test: Add kunit test case for regions age accounting Date: Mon, 30 Mar 2020 13:50:40 +0200 Message-ID: <20200330115042.17431-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200330115042.17431-1-sjpark@amazon.com> References: <20200330115042.17431-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.134] X-ClientProxiedBy: EX13D37UWC003.ant.amazon.com (10.43.162.183) 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 498c637b78ff..133de6c70c37 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -540,6 +540,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); @@ -556,6 +558,9 @@ static void damon_test_merge_regions_of(struct kunit *test) r = damon_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