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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 58979C54FB3 for ; Thu, 29 May 2025 11:54:44 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4b7PtV52mzz2y8t; Thu, 29 May 2025 21:54:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1748519682; cv=none; b=okh78V6cSPHZU9GMo3R5bZsrvOIaYuAoNGHeCkTmEoDnEE14Vl5MGk594qD669RwMan/TqIbex9Y5s26RdFiNJdFpSgJEx9DM6PreLY9T9XACUO78nPYsrKom6ws4PUHrcAXlI8QVB/2nvxWFFozv4lRzYfN6blk4tRXlsVUMqVV+3oRj6KwjtwintI7AH1Hwr5QIW1vNddNNd+lIDtEt0GUNJ0xoxYUD3Jxn6uT11y4caxaHiTLGKYQEoMr8jw+1gAYLoKnPGRemv/2LlrEyM8pHCyIB4zT8A4rc/UC9eQWVzfjtZWED1y0DNHc2BYhwGLRa/5h/gx+9sevJFvjNQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1748519682; c=relaxed/relaxed; bh=sGJqQfkYCDfpnMYyulUs/vbd895i5EGhHIPwf7Mhkcs=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=blTQVMaSQcupw4TAv2PJJdy7tDwM+tS7MUnVewAUVbShU4NPOplHORMZ6PBfpSSF6VnJtjjgdcw1LRhpGLH9AfimPHak1vj2pPkaHW5auUpXilsZ4dsy/c+NIlhPIVEnU1EiJozqcfy9VAXcF1hQ5eTVfq1ewYehGD5mBZJwvo6Cj72OnHGCA5aPwzPC4PYHDuuZBOif7PEdOqy3r29QJT1lFFi6OWYcVk7wYCUPvsso7rhlK8Ra/Rtg+Jap2nYCi/7NJ7rnKDkZ3OPc+Zczyx1PEMzEZpIVSXoZFZb9bngRp/8LuFNBC3hKeFc1rYAcxoD4FMPNodc6C2aKb8Bzig== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4b7PtT6YKdz2xdg for ; Thu, 29 May 2025 21:54:41 +1000 (AEST) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4b7PpG0pPHz6L5j3; Thu, 29 May 2025 19:51:02 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id A1AA5140519; Thu, 29 May 2025 19:54:38 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 29 May 2025 13:54:37 +0200 Date: Thu, 29 May 2025 12:54:35 +0100 From: Jonathan Cameron To: Alistair Popple CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 07/12] mm: Remove redundant pXd_devmap calls Message-ID: <20250529125435.00001378@huawei.com> In-Reply-To: <2ee5a64581d2c78445e5c4180d7eceed085825ca.1748500293.git-series.apopple@nvidia.com> References: <2ee5a64581d2c78445e5c4180d7eceed085825ca.1748500293.git-series.apopple@nvidia.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To frapeml500008.china.huawei.com (7.182.85.71) On Thu, 29 May 2025 16:32:08 +1000 Alistair Popple wrote: > DAX was the only thing that created pmd_devmap and pud_devmap entries > however it no longer does as DAX pages are now refcounted normally and > pXd_trans_huge() returns true for those. Therefore checking both pXd_devmap > and pXd_trans_huge() is redundant and the former can be removed without > changing behaviour as it will always be false. > > Signed-off-by: Alistair Popple > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 8d9d706..31b4110 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1398,10 +1398,7 @@ static int insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr, > } > > entry = pmd_mkhuge(pfn_t_pmd(pfn, prot)); > - if (pfn_t_devmap(pfn)) Didn't this go away in patch 5? I didn't check but this looks like a bisectability issue. > - entry = pmd_mkdevmap(entry); > - else > - entry = pmd_mkspecial(entry); > + entry = pmd_mkspecial(entry); > if (write) { > entry = pmd_mkyoung(pmd_mkdirty(entry)); > entry = maybe_pmd_mkwrite(entry, vma);