From patchwork Mon Jan 9 21:33:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 41166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2392154wrt; Mon, 9 Jan 2023 13:35:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXuhcJtKk9phXLQbm+cjLQIKBQiDGrd/Ux1lgfhuZXnlSSCns4zBcT8hPZmtefuQxGkn9auH X-Received: by 2002:a17:902:9888:b0:192:ce7e:93b7 with SMTP id s8-20020a170902988800b00192ce7e93b7mr28633691plp.49.1673300099892; Mon, 09 Jan 2023 13:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673300099; cv=none; d=google.com; s=arc-20160816; b=gHJyqDmFv1sfJNMHRvQtKQwYCrhyREZ3Ty3JIQ6emR1k5odXj0hrYrz002iiyQ8CHw ROX+3SiqZ9kaJylhet+WeJNHNlK9e2SBdXZQHUIToxuyQ8yRpf6cAQcqUBSf6JDU2tbS +9OhwFxfro2pb8q+O/Wr00odjPy+Kfn0ws8Sgv0e+CYUINjru7OUkUY4vQtRnfMzQXs1 LcLWFh/GLs/N5L3nTGxPpvHX7dwtPTdD3+aqjq2SeOSUooCmpWbaVakX4v4MUiVM3OK4 G6UxrseB6vyUiklORFYJ79Kpv8PRcSwxhPnMsiVyHLKKuysl1UVf4/N5aDlgmVZpjZSL pcrw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a170902b40100b00179cf094dccsi8932737plr.526.2023.01.09.13.34.46; Mon, 09 Jan 2023 13:34:59 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754582325374633191?= X-GMAIL-MSGID: =?utf-8?q?1754582325374633191?= 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++;