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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62D4DC433E2 for ; Tue, 8 Sep 2020 12:16:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3236221D79 for ; Tue, 8 Sep 2020 12:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729275AbgIHMFL (ORCPT ); Tue, 8 Sep 2020 08:05:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:34846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730076AbgIHL4L (ORCPT ); Tue, 8 Sep 2020 07:56:11 -0400 Received: from gaia (unknown [46.69.195.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AB9520936; Tue, 8 Sep 2020 11:32:13 +0000 (UTC) Date: Tue, 8 Sep 2020 12:32:11 +0100 From: Catalin Marinas To: Anshuman Khandual Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, will@kernel.org, akpm@linux-foundation.org, Mark Rutland , Marc Zyngier , Suzuki Poulose , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics Message-ID: <20200908113210.GC25591@gaia> References: <1597655984-15428-1-git-send-email-anshuman.khandual@arm.com> <1597655984-15428-2-git-send-email-anshuman.khandual@arm.com> <20200903165631.GC31409@gaia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 08, 2020 at 03:48:08PM +0530, Anshuman Khandual wrote: > On 09/03/2020 10:26 PM, Catalin Marinas wrote: > > On Mon, Aug 17, 2020 at 02:49:43PM +0530, Anshuman Khandual wrote: > >> pmd_present() and pmd_trans_huge() are expected to behave in the following > >> manner during various phases of a given PMD. It is derived from a previous > >> detailed discussion on this topic [1] and present THP documentation [2]. > >> > >> pmd_present(pmd): > >> > >> - Returns true if pmd refers to system RAM with a valid pmd_page(pmd) > >> - Returns false if pmd does not refer to system RAM - Invalid pmd_page(pmd) > > > > The second bullet doesn't make much sense. If you have a pmd mapping of > > some I/O memory, pmd_present() still returns true (as does > > pte_present()). > > Derived this from an earlier discussion (https://lkml.org/lkml/2018/10/17/231) > but current representation here might not be accurate. > > Would this be any better ? > > pmd_present(pmd): > > - Returns true if pmd refers to system RAM with a valid pmd_page(pmd) > - Returns false if pmd refers to a migration or swap entry Yes, that's better -- Catalin