Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3647842lfb; Mon, 9 May 2022 00:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc0pdDlNtChC5ZBWhDK2oWsUa8Nv0j6qllYxtLcxAjPOe4XQXAhvQYSIn4rgJi3VPIm+Gn X-Received: by 2002:a63:618d:0:b0:3c6:2b4b:473c with SMTP id v135-20020a63618d000000b003c62b4b473cmr12029659pgb.395.1652082305327; Mon, 09 May 2022 00:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652082305; cv=none; d=google.com; s=arc-20160816; b=qabQyQ1THUtw7Wr6tqiXvPIih06N4JB0n9fcEY/zjwZCkgWGWmQ4xZ3W+zxtF5xjPl 1DSCfyBlCMVVduqv24BqBu429eeScwpTxtsTRfPrABZXaaZk0QXbDa0RLHd+3mty3vkM iP1celEFiUyhe3hMjxcGnqgVW+jSlWMrjDPJqB9lGqaNaKAWt1oUybRy10n1q7STMLIn tCaa6ylPn1LylRQHl8HURU8+8uNqnBppMX2jDeFHCpRW0GZ8qlntsLXhQgG32kpEy2LX AQt6w3HkV533W5Ik1p5pv9+QbSGWVJt040mrsl7b6rdbb9gWo5XwLFJdKhV66Symelbi xP0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=0D6xKB/6lmBWsmABBzauQShHnBDXTx0jN5yC8PYlgAM=; b=iR3vAJbdLXpsFOJgL4C3ywsytQ/pfEzQdMaKw4SCKigC4W+1tvonybUycXwhtGQ6hM XOD3CqycbL58AOZl5/pNdKrFjFAQNE7Ec198EEMJW56tiCn28AS5iYKTRpzxSYsX43MG kiZcDsQ5gbwakH+GK3aeTZ0yuUEysnzC5Yz52/LAOYmmsLHw6ahXk+FyyZ6NfJzTAya3 Z4P29vdA76lxJiBosVjQW9Qx4gK3agbuGDVZQr+Y4VH1R0XviSlGOqfnkP/Ll2UKL3hQ 0ULsmGFkR8uL/JsR8gsBpD7l60PYL5nqQ35gIxtYFqSoHAMSgNHybSs3cPgaw/w03WfW Z/WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k4-20020aa788c4000000b0050d679a9c44si15209820pff.186.2022.05.09.00.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E34D21C83C3; Mon, 9 May 2022 00:39:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbiEHJDN (ORCPT + 99 others); Sun, 8 May 2022 05:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbiEHJDA (ORCPT ); Sun, 8 May 2022 05:03:00 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 188E5BCB7; Sun, 8 May 2022 01:59:09 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VCZrFB4_1652000345; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VCZrFB4_1652000345) by smtp.aliyun-inc.com(127.0.0.1); Sun, 08 May 2022 16:59:06 +0800 From: Baolin Wang To: catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, mike.kravetz@oracle.com, akpm@linux-foundation.org, sj@kernel.org Cc: baolin.wang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/3] fs/proc/task_mmu: Change to use huge_ptep_get_access_flags() Date: Sun, 8 May 2022 16:58:53 +0800 Message-Id: <62de656111dcdb8d189698316f1c2721753d7c7a.1651998586.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 The ARM64 platform can support CONT-PTE/PMD size hugetlb, which can contain seravel continuous pte or pmd entries. However current huge_ptep_get() only return one specific pte value for the CONT-PTE or CONT-PMD size hugetlb, which did not take into accounts the subpages' dirty or young flags. So the gather_hugetlb_stats() will miss some dirty hugetlb statistics. Thus change to use huge_ptep_get_access_flags() taking into accounts the subpages' dirty or young flags of a CONT-PTE/PMD size hugetlb, to make the hugetlb statistics more accurate. Signed-off-by: Baolin Wang --- fs/proc/task_mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f9c9abb..3f224a7 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1880,7 +1880,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr, static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask, unsigned long addr, unsigned long end, struct mm_walk *walk) { - pte_t huge_pte = huge_ptep_get(pte); + pte_t huge_pte = huge_ptep_get_access_flags(pte, + huge_page_size(hstate_vma(walk->vma))); struct numa_maps *md; struct page *page; -- 1.8.3.1