Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3345207ybl; Sun, 25 Aug 2019 13:51:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuounOelC9M+n3TQ8R6L8vJD8CWFK7UA5ExknHk3T+GqGbn5DpcAuJhWF+aiOvXQgCL1ts X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr15447006plg.117.1566766302849; Sun, 25 Aug 2019 13:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566766302; cv=none; d=google.com; s=arc-20160816; b=RH0t+I6SqpUOsrzTJKMAfCNula9pBxgrnUbIp8cjc1AvznzQniqaEMyVsI1NeVlXzs Ch+0nqpWtHEahrXekNDtnl+/ZKCoSpqXh2uc29gg7mRZlrbNNurkTKIaP3JhZ/lL2uRa Q+q/ualEegL58iBIk8gLk5rBGw4akWqmOFWJRnPFkr38EfN/7U1Vy2nzkBs0o8zV4eLv KEyGZH5NuWGr6JSpI8mxVOWHERiFL1Iy4OXCXWXBs66UU1T4RnK27fqv/SdgzAnedcWN kdeXSZQBM04QXzydM/ZrO9Hx5cFROYsRglQPwq10KP2BjmHDnqPER+8JUdM8MurXWRsY c2wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=+zhJzMhw6LdP2t6/07CSEKMx7kRxH5t+tfZUooODa+g=; b=tCkyFZfOk53DcrQqNw7tk2lBrLIAPwxfIVxcjJ0tytnyuTeoJRg3UWHCuuL8T6tvtY jm4L61j2M6omFMq3/uBIRF4xPL+FISQi9/YY9ecEjNjxhxwQF61Q4JtBPNUg2ok569u2 jdx2R8vn2vKm5iUV1yT8KAjHzQZpTBT9f5ZG5Q3lrZtnDucOpIq2T62mqEMDr5MbKmyq l9/w15NUUBqI4YnSizNIt2QzdlB6j4OGIZSxbY/jdWvUvrqUGgVRHVdffg8rPML/WYuq rU3jt1lQiU8b6RU7+a9SUie8PmqwNlSmQGviCfew0iub9mKqQJRVRL8gNhjhZKLEEB6K UPSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="L2Jg/CqW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si7631753plp.59.2019.08.25.13.51.27; Sun, 25 Aug 2019 13:51:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="L2Jg/CqW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729115AbfHYUGa (ORCPT + 99 others); Sun, 25 Aug 2019 16:06:30 -0400 Received: from mail-vk1-f201.google.com ([209.85.221.201]:45829 "EHLO mail-vk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728730AbfHYUGa (ORCPT ); Sun, 25 Aug 2019 16:06:30 -0400 Received: by mail-vk1-f201.google.com with SMTP id c65so6663931vkg.12 for ; Sun, 25 Aug 2019 13:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=+zhJzMhw6LdP2t6/07CSEKMx7kRxH5t+tfZUooODa+g=; b=L2Jg/CqWUEmpIPG5COD9iu+asYhkTPlrV1Q3nfbiS5JqpeyeQnVPxOO004YatNuXGf IgNfpUj++zV6+P/wRxIyR8YTZkOnyFOrRMiBK/iWdspcpYQ/KE4jfczN2CAXOjsbjxp2 KPBOK4JZFlOEwrkTbfaA8vlJYhSeHMgy2NOHcKNcm5bQITXTprbs+teNnc1K0gCWygv6 s6XrXKTToFH57nXNdsBmUAjL+pLjKWkLeb7k6wwPsyxyge0vVicDVzpevV7DEKKozbmn xtZw/n1Y4ugLmDh16MnQjI7OxbqpgUvVEaHzjTfD3yzx7ZEP3Z9QdMfPWp4m1yHVEr7o m/9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=+zhJzMhw6LdP2t6/07CSEKMx7kRxH5t+tfZUooODa+g=; b=ePO9WHUZ2VPHeC+woF7jUYMMVfaDBdAXjujsgR7qBXNu9sKWJZsnmMSlhDE5d+5hWe miECC5Iwx9C3EHsZ7XmaBue/AnHumKsm6uj5tU68ORODPiv8Z9XujsmHvZP224MFxOeN +5ufXyLgZXXtCBJQbBIQpqJh2z+q8BGWbzHjngMSaY8EunIEtikqhLeIJEhWjPN+/QzL +jMc9iEFu1FVklP6bNa2hqGRDWMwj6FffKJ7qtMy9qCZ4m6CmykKvnvMY4aO7bd8y3S8 18Lry6Xh3g/xPN2dQD1G1rV29y0v8LGr4cph5YnneR5GxU3/LAfN2xCubMICT0Cy8VqS b23A== X-Gm-Message-State: APjAAAXS2gSD+w6uFspu/xxkh1/+vrijFVNNnDwWdiK+ibLvNbmcKxQc bOHaoUatVOuibivJAC0XcS/CUM4yfiA= X-Received: by 2002:a67:bb18:: with SMTP id m24mr8073907vsn.201.1566763588690; Sun, 25 Aug 2019 13:06:28 -0700 (PDT) Date: Sun, 25 Aug 2019 14:06:21 -0600 Message-Id: <20190825200621.211494-1-yuzhao@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog Subject: [PATCH] mm: replace is_zero_pfn with is_huge_zero_pmd for thp From: Yu Zhao To: Andrew Morton Cc: Matthew Wilcox , Ralph Campbell , "=?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?=" , Will Deacon , Peter Zijlstra , "Aneesh Kumar K . V" , Dave Airlie , Thomas Hellstrom , Souptick Joarder , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For hugely mapped thp, we use is_huge_zero_pmd() to check if it's zero page or not. We do fill ptes with my_zero_pfn() when we split zero thp pmd, but this is not what we have in vm_normal_page_pmd(). pmd_trans_huge_lock() makes sure of it. This is a trivial fix for /proc/pid/numa_maps, and AFAIK nobody complains about it. Signed-off-by: Yu Zhao --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index e2bb51b6242e..ea3c74855b23 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -654,7 +654,7 @@ struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, if (pmd_devmap(pmd)) return NULL; - if (is_zero_pfn(pfn)) + if (is_huge_zero_pmd(pmd)) return NULL; if (unlikely(pfn > highest_memmap_pfn)) return NULL; -- 2.23.0.187.g17f5b7556c-goog