Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6893858rwl; Mon, 9 Jan 2023 14:41:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQg2ioeIemOVDGUFgyet1FBvcBYSDfnLLm5uJJp9wDaK5cIVbL54g7FfSmL3diD2DeWYDh X-Received: by 2002:a17:906:309a:b0:819:7d8f:9684 with SMTP id 26-20020a170906309a00b008197d8f9684mr60826872ejv.72.1673304082876; Mon, 09 Jan 2023 14:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673304082; cv=none; d=google.com; s=arc-20160816; b=g0QsggFNKHdjSJz/f6uypKP/e6/zMNWFleVbaySkpsJN0TnsmM+EC3siQdJrpU47Ab G9rC8uzZ2Upw639QUSkc0frF2i1j0fdbFla/LSaPoLNsWGIpyIeBCdJ5kqgpMYoU/aMo U1z8A0tLxMf9FGVUKNkv3CiqGuGaaTtRzPoqppZkAYuHm3c9p+Lz3rP40nyeLAXznzzs AlUbht1rFPZGuu9mstadW6kb2i2VNGUBWlBV9p5Nffgm+guAe3E/7t4uwizV5zgJ/7Cj S6VCw7pgWwrN5ouoVelBG4esNFeAd61dmYiTq+/qEUDDNfKRpiG4HUZ0zrzRYDJsMrH4 N0Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N0iiOREKjAiI6kLAk02vCa4VECye4nwxU8RPiP9HoGQ=; b=wnDWqm2K5nRtnukVpGCJyqsqHTtvzpnrz3Scc2+mu/QIIkOPa9xwNeeKzstugTihYW 9HXlM1K+G7CEcoNTLUMoIphYEuwOW8oIbnRbEwMgZsUTi6DzpDKRRn3BgydGX//vE4zS QukoByS/MmU+k+37xaJFkeb3uvbawBujlgCjmrNbE13AI4mzly2I7AFgcplKM2LwUdac mOahCm177H3hjoadP0izCaxET8k8Ga3r1zh5Ce6N6s0C+1hsA7bgWodF11OJyY23lo/c 1Kjd8XmvF+mvNcm2bgiNmlyWBpXs1V6dUngEcXCR2I2CQdl32WucHE/Zh30aop/HhIwP JGkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CkayMLf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm20-20020a170907949400b007adc4a0aeb5si9630690ejc.873.2023.01.09.14.41.09; Mon, 09 Jan 2023 14:41:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CkayMLf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjAIVdx (ORCPT + 53 others); Mon, 9 Jan 2023 16:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjAIVdt (ORCPT ); Mon, 9 Jan 2023 16:33:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CA3E2E for ; Mon, 9 Jan 2023 13:33:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6599E61414 for ; Mon, 9 Jan 2023 21:33:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3813C433F2; Mon, 9 Jan 2023 21:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673300028; bh=CFEeibNvvYAHsooB/GZxZzGLeG1gUo5uWWp85VJYZOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CkayMLf4IhwPE5yfzgDGZfwtnsgWnvEkfeAXD5O25NOF846s/PGNbZIBST+o9XJfu YTzFb7YVkNVDpiaxedFNYwJ5bGBdaSZlzL0dJifZseNQaZ9fVWqVQmyDdHhV+vKXja HASc/1EM1sgLdlweKLpxJWF0NKPshrKc8IjLEngSJK+LCP2VWTSJxuduVYw99ul/ij NzCuJU0/oB5GhgMqwXkr0/VEu2XMLuavwrhnAr0bYcTbsg9oa3xyQuy7Jd7rGl+BIG b/Aw174M8zeE6Hi9q4YH1GA+PwK7bX+GynKfII38j5rrg51mvQfOX0XcBjXRTshqIX 7XmdlB/xwMVHg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] mm/damon/paddr: rename 'damon_pa_access_chk_result->page_sz' to 'folio_sz' Date: Mon, 9 Jan 2023 21:33:33 +0000 Message-Id: <20230109213335.62525-5-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230109213335.62525-1-sj@kernel.org> References: <20230109213335.62525-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DAMON's physical address space monitoring operations set is using folio now. Rename 'damon_pa_access_chk_result->page_sz' to reflect the fact. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 99d4c357ef2b..65c1e0f91535 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -80,7 +80,8 @@ static void damon_pa_prepare_access_checks(struct damon_ctx *ctx) } struct damon_pa_access_chk_result { - unsigned long page_sz; + /* size of the folio for the access checked physical memory address */ + unsigned long folio_sz; bool accessed; }; @@ -91,7 +92,7 @@ static bool __damon_pa_young(struct folio *folio, struct vm_area_struct *vma, DEFINE_FOLIO_VMA_WALK(pvmw, folio, vma, addr, 0); result->accessed = false; - result->page_sz = PAGE_SIZE; + result->folio_sz = PAGE_SIZE; while (page_vma_mapped_walk(&pvmw)) { addr = pvmw.address; if (pvmw.pte) { @@ -103,7 +104,7 @@ static bool __damon_pa_young(struct folio *folio, struct vm_area_struct *vma, result->accessed = pmd_young(*pvmw.pmd) || !folio_test_idle(folio) || mmu_notifier_test_young(vma->vm_mm, addr); - result->page_sz = HPAGE_PMD_SIZE; + result->folio_sz = HPAGE_PMD_SIZE; #else WARN_ON_ONCE(1); #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ @@ -118,11 +119,11 @@ static bool __damon_pa_young(struct folio *folio, struct vm_area_struct *vma, return !result->accessed; } -static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz) +static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) { struct folio *folio = damon_get_folio(PHYS_PFN(paddr)); struct damon_pa_access_chk_result result = { - .page_sz = PAGE_SIZE, + .folio_sz = PAGE_SIZE, .accessed = false, }; struct rmap_walk_control rwc = { @@ -157,25 +158,25 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz) folio_put(folio); out: - *page_sz = result.page_sz; + *folio_sz = result.folio_sz; return result.accessed; } static void __damon_pa_check_access(struct damon_region *r) { static unsigned long last_addr; - static unsigned long last_page_sz = PAGE_SIZE; + static unsigned long last_folio_sz = PAGE_SIZE; static bool last_accessed; /* If the region is in the last checked page, reuse the result */ - if (ALIGN_DOWN(last_addr, last_page_sz) == - ALIGN_DOWN(r->sampling_addr, last_page_sz)) { + if (ALIGN_DOWN(last_addr, last_folio_sz) == + ALIGN_DOWN(r->sampling_addr, last_folio_sz)) { if (last_accessed) r->nr_accesses++; return; } - last_accessed = damon_pa_young(r->sampling_addr, &last_page_sz); + last_accessed = damon_pa_young(r->sampling_addr, &last_folio_sz); if (last_accessed) r->nr_accesses++; -- 2.25.1