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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17098C433EF for ; Fri, 17 Jun 2022 17:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dh3jLy0A94klL1IubGuAhJZVQzX82wu+APpOVUubux0=; b=KpglrGIWfmPAM7 mfdCNfD9kSimEJI5E3q4lPW7n/xQ8kCT+1VCWjRLDtSJXdVvOCetxiVmY5EiPGDN4ItR5EY6+kJee ZJw62dWzluhVyia1H6gNJDgJLKG81FAI7SGhfg+7OFDS353vyHxZDO4FD6Z6Pv1qwnh7XKvmvg4e/ bmRMW8HcdryN+GuTuq5EBxcPF6Dk9Xv7993rRxytDvFY7luawit324BSSOPQY2awemOy9sx1TsiKV wJwUvFw0h2Dq+eVzioetrwvUx7Ai1NdapwjEizbSnggOjCR29LJQlzRtu/QY/ANoPHBhvoxbm9QOQ Z+GOZhUf4fZu3YHudcmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2G3F-008VLo-Du; Fri, 17 Jun 2022 17:46:33 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2G3C-008VKu-5P for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 17:46:31 +0000 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 BB16C61DD9; Fri, 17 Jun 2022 17:46:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94DD3C3411B; Fri, 17 Jun 2022 17:46:26 +0000 (UTC) Date: Fri, 17 Jun 2022 18:46:22 +0100 From: Catalin Marinas To: Baolin Wang Cc: will@kernel.org, mike.kravetz@oracle.com, songmuchun@bytedance.com, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] arm64/hugetlb: Simplify the huge_ptep_set_access_flags() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_104630_285133_7742B308 X-CRM114-Status: GOOD ( 16.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 25, 2022 at 06:31:09PM +0800, Baolin Wang wrote: > After commit bc5dfb4fd7bd ("arm64/hugetlb: Implement arm64 specific > huge_ptep_get()"), the arm64 specific huge_ptep_get() will always > consider the subpages' dirty and young state for CONT-PTE/PMD hugetlb, > so there is no need to check them again when setting the access flags > for CONT-PTE/PMD hugetlb in huge_ptep_set_access_flags(). > > Meanwhile this also fixes an issue when users want to make the CONT-PTE/PMD > hugetlb's pte entry old, which will be failed to make the pte entry old > since the original code will always consider the subpages' young state > if the subpages' young state is set. For example, we will make the > CONT-PTE/PMD hugetlb pte entry old in DAMON to monitoring the accesses, > but we'll failed to monitoring the actual accesses of the CONT-PTE/PMD > hugetlb page, due to we can not make its pte old. > > Thus remove the code considering the subpages' dirty and young state in > huge_ptep_set_access_flags() to fix this issue and simplify the function. The ptep_set_access_flags() semantics (non-huge) never clear the access flag, so mkold is not allowed. I think damon_hugetlb_mkold() is wrong in assuming that huge_ptep_set_access_flags() allows a young->old huge pte transition. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel