Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1082959pxu; Thu, 8 Oct 2020 02:53:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYg5xFUCOW6cLzAo1ORNNecj/njIMMDCquVMLpbo8agAG7Py4BQIvw+c6fB5G7sNedacMH X-Received: by 2002:a50:ec8e:: with SMTP id e14mr7905842edr.98.1602150807354; Thu, 08 Oct 2020 02:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602150807; cv=none; d=google.com; s=arc-20160816; b=ic7fo5Goq3wV2ixL0P96cBW82YgM1KlrefQH5yVjFgzc4t9q3+IoR9zyTtkRR5uwF+ prFqs3eYzPKIJ7RPX+iYkIyeV1WUZhcRw05cHzfN0YAXa4e2GpgzCaDRP38kd+Hs0xxA m5uL4GrpkTwALachPyNLfXU1URDNJboGlbB1xUeZ2obLY87PuSVVEhBn8ANt6EuCpYCJ GaYmmHB2WAB7P0zZesGFuyPM/YL2WJJErzF2R/+H3vDjuAjmkjyH2C+dlzs8SIuzDlHs yp9FgaeWMWV4nlDX/HYy31AQj4T8NQ2Js1WGCu1zeEs3xa2HqFTdSynWuwZnISNQlCAI qCPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:to:subject:from; bh=+KjKcrAOz4N3Q+iJmL899yE3kPi7r89f+ECKehfuya0=; b=lgow70FQd3NU4+lU9NqVbgxW7RCSwhgu14ir6LfP/5e3kc5Al79Bc4sr5ve7/R8oa3 BYbzsFY+ab64tvxDe7Lac4/xjgVds7ketPgOnKUJKESKoJzQH8V0x+Hrxex7mfI2BKeO 3DhKAZ6+3XlkQxHS3vFfnXpIFZ39xEY0+2R0XvUnbYZ4Bh8m4Ld75EJ4L/BoNeGbbqRx yaHAJav86fm56rC1/v+lH2nShim9KL12apgjkrdbM+5jaLDdXfKTd7KWViLRGDkVcDFn V48Q32IN9u/hrkzGpuRoLtvKJxPvD1kfVrecYRN1U9y6Wd/lfRw4YoJq4443CFRqPCRb 0N5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e30si3045119edj.442.2020.10.08.02.53.03; Thu, 08 Oct 2020 02:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729300AbgJHJth (ORCPT + 99 others); Thu, 8 Oct 2020 05:49:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:44728 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgJHJtf (ORCPT ); Thu, 8 Oct 2020 05:49:35 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4C6RHv6vbCz9v0Jb; Thu, 8 Oct 2020 11:49:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id mnZbLhC9ScyS; Thu, 8 Oct 2020 11:49:31 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4C6RHv5nYlz9v0JY; Thu, 8 Oct 2020 11:49:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A96338B832; Thu, 8 Oct 2020 11:49:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id xNCjMtQPDKXQ; Thu, 8 Oct 2020 11:49:32 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A45508B82F; Thu, 8 Oct 2020 11:49:29 +0200 (CEST) From: Christophe Leroy Subject: mm: Question about the use of 'accessed' flags and pte_young() helper To: linux-mm , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "Aneesh Kumar K.V" , Nicholas Piggin Message-ID: <31ef1305-1fd4-8159-a2ca-e9968a568ff0@csgroup.eu> Date: Thu, 8 Oct 2020 11:49:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a 10 years old commit (https://github.com/linuxppc/linux/commit/d069cb4373fe0d451357c4d3769623a7564dfa9f), powerpc 8xx has made the handling of PTE accessed bit conditional to CONFIG_SWAP. Since then, this has been extended to some other powerpc variants. That commit means that when CONFIG_SWAP is not selected, the accessed bit is not set by SW TLB miss handlers, leading to pte_young() returning garbage, or should I say possibly returning false allthough a page has been accessed since its access flag was reset. Looking at various mm/ places, pte_young() is used independent of CONFIG_SWAP Is it still valid the not manage accessed flags when CONFIG_SWAP is not selected ? If yes, should pte_young() always return true in that case ? While we are at it, I'm wondering whether powerpc should redefine arch_faults_on_old_pte() On some variants of powerpc, accessed flag is managed by HW. On others, it is managed by SW TLB miss handlers via page fault handling. Thanks Christophe