From patchwork Mon Jan 9 21:33:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13094366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A46D9C54EBD for ; Mon, 9 Jan 2023 21:33:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 004ED8E0003; Mon, 9 Jan 2023 16:33:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF7A08E0001; Mon, 9 Jan 2023 16:33:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE7468E0003; Mon, 9 Jan 2023 16:33:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D20B08E0001 for ; Mon, 9 Jan 2023 16:33:49 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 91F90A0544 for ; Mon, 9 Jan 2023 21:33:49 +0000 (UTC) X-FDA: 80336562978.29.B71BC77 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id F06CE140014 for ; Mon, 9 Jan 2023 21:33:47 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iI0kvQY1; spf=pass (imf09.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673300028; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=o7gimKyLLJw9A6V//eR1L6zJuoDP3fS3F+7uvlkamiA=; b=kjvPtTWYbJiXZkqGaZ16R5SCDhuWAHZufJHe2GWHU6RS2Jd0QVb00llW6ivIDtWZYfjI75 n28+A5Y4Eb9yjGcJwtv0cl2KJGlk+bcfG+roT4X+8bbXeD3vJ+Svo2jIKjZS8bK7WICnd6 WYvk3FJWAfwK1xREiu8EZQ7VcyknBGo= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iI0kvQY1; spf=pass (imf09.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673300028; a=rsa-sha256; cv=none; b=TegoR0HGD6X3j3tcpQoe4x/qMMxjHmwB6KJuLH9pUgsTQjEV57XFHG9IevSgXJj+ZrtOwG wUQky/AafAJI8XC4qOcgiiJ0f/6h1gGlgZcyk83LcY38oCPhCdEXUGNFKncWx0N2QL/WIh lv7bjMYHnE2mmc2Dy0DSd3BoK4HZ/O0= 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 150F7613FB; Mon, 9 Jan 2023 21:33:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F18BDC433F1; Mon, 9 Jan 2023 21:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673300026; bh=8zePhCnELAS1QJzxrjEP75j3wPseZorjwjhVisLqJLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iI0kvQY14VYnZdX+nOXPYkE3NYQ684HNWh99BZ3HGSB44hAC1XoKXeyhI00O79K6w baT02EhqlaaajEh5EOvLemJQ/HQvCXaL6sXFaCAqhiR5TnV4vHFxqkYJsxwHwsiUbL RRxzElNee++MXz9VfFsYQ8CR47R+UgOqES3k8M4JMiDSkcE+7rSG6/r4dpWWLTprUL DXXWH5WGqOtB3POAMRJ/7HmiW0iPUezsF6QKlwQVYwZcYHaD93ZvADEpOP5D6eBoO1 rDzq6VTp6zIC3RvJ28SRNRMF5F3miHkJE18KNJl7SuBX8OaT9jC4tF4OzqsUfIcI9O vCW3K43C/4img== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] mm/damon/vaddr: rename 'damon_young_walk_private->page_sz' to 'folio_sz' Date: Mon, 9 Jan 2023 21:33:30 +0000 Message-Id: <20230109213335.62525-2-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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: F06CE140014 X-Stat-Signature: 4d7qoe8ptm5z4sbfgzu6rhedcufdd6zm X-Rspam-User: X-HE-Tag: 1673300027-897688 X-HE-Meta: U2FsdGVkX19rkGHI9Dbu8YRl/g8zlQG4FMNsCaoKLbM4Gi1RbDpy1SWMgVDV4QrhjKxquYqMZaJNzMbRT3722mQWTw3EeSsqwhwVboGszshaWbPFBC9/qnu47BRA5vdho52VRitxEuVwFurvk7Ip6QtYT75i+ZWzJaCRO/XnmzhvafvNIlVIuCfh8NMKx5goxqAx+1K5EKS09iFHkgg/yMNOZ90yGlwF0YaqXCUo2fzgJREIAwFUXam0ibG3XXLzZnvfevVzBiGg8vTQrOuw3Q909vSUYUa9ZMqN7EwD0reWw7ZBWAsDT9/qSe8zSgBlR9LYdwn+ZREqGNg2I8nm9pKI4tF6yzwWp6ldEwi/hvftDqa1jMWSN5s3SUvAJQSfmrWZL12vU9IKX9xWAc5KLf+JNALOIbcTEM3iJez1IET1oRs8ogxSTYwDomz56NgHmLKX7sqIWEbaNq/gbVYGtHZRVlYHiTSmmfvUbthPlGxNjuigmyLvoNoZL5866pabUBhO+SiYTI2VsbOmHEUNYpHegR6UyBBCOTca36GxZk24VqdIuYbiRu2njLa3WOT2ylTHiTQRoIzlUOIZT2kyEXtT3EpBZ1BpRBHNo8F2Jmu99ry1hWQjoDvtquMjzB0lWGNtKpOtPrfBXN1dfD3qjs6Jc2bCJuxKDXeLwMDu+3k0ya2WyPn09H8DJbF4RnUgh0xn+DYC9vY+7sNOR0JZ+jxrQO6j1rJHpuRYEzFAqMapxEbBnM8rqL48On8lyo7LhP8PslqLmN8DIWXILAX92Cqi+Kq7i2N+2oZhrBN7GOASTDEF8tXC2639jChLiaII3hg3K91/6hD1XYBBhUm/hYcpvdQ7dVeSJY2Au30BtwvNzlxpT+BR5lDjLEXTr7fcm4Df7zFJeqfgLKzP5A75gg54euGM5uH33jgsu9PmFA1NQ/mTHZY5et43aV0oVVvs+VETl6jxZz5ybWebnZ8 XN0E73DH JwqMnvckTuwQZ4t+FNWdBcBM4X26Vw5C3zbRXHmPYxNABRepB0r/UUhJfY33mVyaeh1+TZ6IEPAEGBW4dV0sHEqT9sVDu+gOSlKfs3hshXDI1lABXKneOq9fAGg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: DAMON's virtual 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/vaddr.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index 9d92c5eb3a1f..d6cb1fca1769 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -422,7 +422,8 @@ static void damon_va_prepare_access_checks(struct damon_ctx *ctx) } struct damon_young_walk_private { - unsigned long *page_sz; + /* size of the folio for the access checked virtual memory address */ + unsigned long *folio_sz; bool young; }; @@ -452,7 +453,7 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr, if (pmd_young(*pmd) || !folio_test_idle(folio) || mmu_notifier_test_young(walk->mm, addr)) { - *priv->page_sz = HPAGE_PMD_SIZE; + *priv->folio_sz = HPAGE_PMD_SIZE; priv->young = true; } folio_put(folio); @@ -474,7 +475,7 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr, goto out; if (pte_young(*pte) || !folio_test_idle(folio) || mmu_notifier_test_young(walk->mm, addr)) { - *priv->page_sz = PAGE_SIZE; + *priv->folio_sz = PAGE_SIZE; priv->young = true; } folio_put(folio); @@ -504,7 +505,7 @@ static int damon_young_hugetlb_entry(pte_t *pte, unsigned long hmask, if (pte_young(entry) || !folio_test_idle(folio) || mmu_notifier_test_young(walk->mm, addr)) { - *priv->page_sz = huge_page_size(h); + *priv->folio_sz = huge_page_size(h); priv->young = true; } @@ -524,10 +525,10 @@ static const struct mm_walk_ops damon_young_ops = { }; static bool damon_va_young(struct mm_struct *mm, unsigned long addr, - unsigned long *page_sz) + unsigned long *folio_sz) { struct damon_young_walk_private arg = { - .page_sz = page_sz, + .folio_sz = folio_sz, .young = false, }; @@ -547,18 +548,18 @@ static void __damon_va_check_access(struct mm_struct *mm, struct damon_region *r, bool same_target) { 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 (same_target && (ALIGN_DOWN(last_addr, last_page_sz) == - ALIGN_DOWN(r->sampling_addr, last_page_sz))) { + if (same_target && (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_va_young(mm, r->sampling_addr, &last_page_sz); + last_accessed = damon_va_young(mm, r->sampling_addr, &last_folio_sz); if (last_accessed) r->nr_accesses++;