From mboxrd@z Thu Jan 1 00:00:00 1970 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 8373CC433EF for ; Tue, 10 May 2022 15:59:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 072F56B0071; Tue, 10 May 2022 11:59:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3CD06B0073; Tue, 10 May 2022 11:59:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E049F6B0074; Tue, 10 May 2022 11:59:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D013C6B0071 for ; Tue, 10 May 2022 11:59:47 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 9D62B121656 for ; Tue, 10 May 2022 15:59:47 +0000 (UTC) X-FDA: 79450294014.21.E3287ED Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf09.hostedemail.com (Postfix) with ESMTP id 1D23E140093 for ; Tue, 10 May 2022 15:59:38 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id x18so17130867plg.6 for ; Tue, 10 May 2022 08:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KuCtcNBo2th0pyg6CQP5aLGHC2ZuCU/pAXEksyolVoU=; b=lgotZpreFtTnnYoimROqXkO4uhY57bam/rtfjWKifG/AuGv+HsZqvuPhBnGSgTaPIF r7ETfUUBr3FS5NT66Fk2LR3UNtOglgYktF3EiL7ZVSq5qtZa2aa/HthnUFjX4+Wdi2k8 S//9aaN3jKuDbnqAPuo/IqPM1LhGt0DvsAaBwqCPhALM48a4cymQbZQkyPxHQM4rWRGw vZxPUyNDdMMtbye0LXX0ayBr/Fe1iGF8FqoK06Y+O8+HunfIhmszFQlb4wcjBePmEUw+ LsUFUFcY6VrSS7eWNkIUlzgL3LS6ri5RkWa6Sp48hI6qhRSFZPpp1O9nIhodgaY1rLux eIcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KuCtcNBo2th0pyg6CQP5aLGHC2ZuCU/pAXEksyolVoU=; b=GmuLHjPcapVrin5n0ORfvx87sZ7vwD7jmXTUZTVbW9YHv6A4LriIGQa7Gy2o/V7JGG w6LVnINMzP59bhDwO/yQJ+g5E9fSAY3TYpe1MN3P42FEmrztny4B1/RY1aBGRCYCDRv1 LWpJLKoF8uN5+ezVpa4apAKxHU4xVROePmEVe19GbxAb+pipcHxuR7zA3u3sYfpaEDyv wLmBKShgR3oN3zmwvj9DhqFHi/sh+CpKuOJK+ELmzlaupuqDTYxQ4pYwOqKJ/3z77N4g IM5r4HqPqMIRB2x1KYYLcvVJnT0JEqQPZqoH83gw6d5QFlzyyoAAOUeXELf2cIE/+XnH UOqA== X-Gm-Message-State: AOAM531K3V7xh6oj8/NuNgDwM1ZUrB1u3Ku7S95T1l8b9Q+I7cMpfkma hpzTKkRavkM8lunMuAG5bZALlA== X-Google-Smtp-Source: ABdhPJxlpU+UaeWLUkm8hatrmy72Dil0hhUtITD5l3Yx7ekqlkw15OjfCbtf7aFVGEXDjdTtLnehQg== X-Received: by 2002:a17:90b:38c7:b0:1dc:77aa:e3d5 with SMTP id nn7-20020a17090b38c700b001dc77aae3d5mr626801pjb.51.1652198385814; Tue, 10 May 2022 08:59:45 -0700 (PDT) Received: from localhost ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id s43-20020a056a001c6b00b0050dc762819dsm10600511pfw.119.2022.05.10.08.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 08:59:45 -0700 (PDT) Date: Tue, 10 May 2022 23:59:41 +0800 From: Muchun Song To: Baolin Wang Cc: catalin.marinas@arm.com, will@kernel.org, mike.kravetz@oracle.com, akpm@linux-foundation.org, willy@infradead.org, anshuman.khandual@arm.com, christophe.leroy@csgroup.eu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/2] arm64/hugetlb: Implement arm64 specific huge_ptep_get() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 1D23E140093 X-Stat-Signature: t4ujfaha3h79sxrn533tc17tw95xwmqe Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=lgotZpre; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1652198378-363529 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: On Tue, May 10, 2022 at 07:12:53PM +0800, Baolin Wang wrote: > Now we use huge_ptep_get() to get the pte value of a hugetlb page, > however it will only return one specific pte value for the CONT-PTE > or CONT-PMD size hugetlb on ARM64 system, which can contain seravel > continuous pte or pmd entries with same page table attributes. And it > will not take into account the subpages' dirty or young bits of a > CONT-PTE/PMD size hugetlb page. > > So the huge_ptep_get() is inconsistent with huge_ptep_get_and_clear(), > which already takes account the dirty or young bits for any subpages > in this CONT-PTE/PMD size hugetlb [1]. Meanwhile we can miss dirty or > young flags statistics for hugetlb pages with current huge_ptep_get(), > such as the gather_hugetlb_stats() function, and CONT-PTE/PMD hugetlb > monitoring with DAMON. > > Thus define an ARM64 specific huge_ptep_get() implementation, that will > take into account any subpages' dirty or young bits for CONT-PTE/PMD size > hugetlb page, for those functions that want to check the dirty and young > flags of a hugetlb page. > > [1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/ > > Suggested-by: Muchun Song > Signed-off-by: Baolin Wang LGTM. Thanks for your work. Reviewed-by: Muchun Song