Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp998076lqt; Fri, 7 Jun 2024 05:24:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVohGk573ukyWjG8SyYXoUmWvywBblVLv7l/cmOadf5/8kSPM6plKlOYZsA+9Jy/qXg0Y4U7Li1BnP7mXVmYjvd+AUyNA9i+7PcZWsGQ== X-Google-Smtp-Source: AGHT+IF2YHl6mbWN1kidkStAEmDM8G4cUHW/YkH+CG3d1+DnZPFjBfPWi51LXcB9uvzkb2t/RhnV X-Received: by 2002:a05:6214:318a:b0:6af:4c7:2c04 with SMTP id 6a1803df08f44-6b059f840c4mr20989586d6.55.1717763082158; Fri, 07 Jun 2024 05:24:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717763082; cv=pass; d=google.com; s=arc-20160816; b=G6sEFX3+ElNPyrHxGsUEtzTjQrIMmRvPCaaDz/hUrGd3IGEc97ZYKe03UzYmI/U2tE XMYwLVdoyNT9ftAyOOWzUp0hbowGsS/icvXa1CxQ7XhXsvj7B6a662OTZ55OLaz56sFf 6JuWV+fgFGfiCUz5I+vBmf/Zlw6lZcvExoX61YhdnP59eu6E/YNO27Plkd60KvkRQrF/ u5V7rWFJEeP6yx3lG0vOn1GnzEKcKzs33dopyUmkkeHHuVcP1yz8WG/NFTubht6+AGe6 SmRVUX+rd3//wyqWbOMdZkesG+cPIVRLlOx5RQniiB9xXqTz9RwXOadlWgRrHXinSPVY WoSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AVo7IPc/OzMgdNcQVcdkp4iZHfQkhLNpmKtGDFarvnM=; fh=51jV7WQxntzmbBmGMw9RLl+8SzlZuq36dY7llxxkwJE=; b=K7StlrwYBHIOT9tRSCz/LLBE2awdoqOZ4ZCKQtYJQ3djX3DMzV9c6nx4AWIlpR5PFE NW8G7qNL4eO7XJb/kh1wZalqRJk4q5g/mleRC3hYAjPV513egG+gYAXMK0Omk2r8gW5y Drmwi3niuxj8sHzrU/0FJzDxNFVk2S/c2h8k+68pLLHQnluqXwJHalrDCbWFKYVCGqFI 9yTqgPBXDw7tZL7C+a7CE+eYintvMqa7UV7+QU/cjSBEc2MpasXj+0CgkxL8kGPXp+me GcglYZVI3iQKjP4zs8f0rokxdICiEuzgUPifSpmLkpuuyqZNVGUJKJhXmSmyGbkLWJ6o zFRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PRxk4tnq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-206018-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f63290dsi3174106d6.23.2024.06.07.05.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 05:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206018-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PRxk4tnq; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-206018-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D986D1C22A16 for ; Fri, 7 Jun 2024 12:24:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96E4D1940B2; Fri, 7 Jun 2024 12:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PRxk4tnq" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 407ED190696 for ; Fri, 7 Jun 2024 12:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717763048; cv=none; b=O61O28Mrmz0Ton7orBbcBRxLYmqu6gcakLGKKRvyIQp8F8jWHYw3OhyxQDpqqzQnYglFFifn8Y5xsDiKMt28XfLYDo2FSUQXf+4Rmx9elX9QpWXQveK6dSO8xpV646qmCsq5LnYfWAmrj2MA39ZgCkCCPaxxVne2CS3maTVuttA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717763048; c=relaxed/simple; bh=kZIr6xLD60e+MbBbyqcbjS2T4bx3h666V+8zvgQT53s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KG2NrtYwEwJ75Nnj5c9zhCFWQrWYf+6554INNQTcOh1/y6rhfUF9G9FtZOo7UQNXUBEdt0xxNItu/Ylh+cgV+2/kl/iNvUElJJly2rqSXJZk/JvxDlJ9Cj21xs3/FBwLLrHVgvn4RxO8T0eZLdIsH7kPPf2aXLORHVitN1EsXnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PRxk4tnq; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717763046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AVo7IPc/OzMgdNcQVcdkp4iZHfQkhLNpmKtGDFarvnM=; b=PRxk4tnqHsjRsEXxkExpiWkDwBduySuvkgGcFoktzxRVlpv5LzwqovVKE2QLQ1vmjGujmv ZfDmJvpTsevPzWhR9+hj1UIDyTcQq6acY8buaQPZXQeQuXV2064famFw7w2C9PjzqFFEqE 7I0flR4ajwo5cufY5Ag0lOPxqDkSbHo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-8Lw9Jl3kOiKOKhr_XOiSIg-1; Fri, 07 Jun 2024 08:24:03 -0400 X-MC-Unique: 8Lw9Jl3kOiKOKhr_XOiSIg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 322EA3C025AC; Fri, 7 Jun 2024 12:24:03 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 569D9492BCE; Fri, 7 Jun 2024 12:24:01 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Hildenbrand , Andrew Morton , Jonathan Corbet , "Kirill A . Shutemov" Subject: [PATCH v1 1/6] fs/proc/task_mmu: indicate PM_FILE for PMD-mapped file THP Date: Fri, 7 Jun 2024 14:23:52 +0200 Message-ID: <20240607122357.115423-2-david@redhat.com> In-Reply-To: <20240607122357.115423-1-david@redhat.com> References: <20240607122357.115423-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Looks like we never taught pagemap_pmd_range() about the existence of PMD-mapped file THPs. Seems to date back to the times when we first added support for non-anon THPs in the form of shmem THP. Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Cc: Kirill A. Shutemov Signed-off-by: David Hildenbrand --- fs/proc/task_mmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 5aceb3db7565e..08465b904ced5 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1522,6 +1522,8 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end, } #endif + if (page && !PageAnon(page)) + flags |= PM_FILE; if (page && !migration && page_mapcount(page) == 1) flags |= PM_MMAP_EXCLUSIVE; -- 2.45.2