From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760425AbcDEVtx (ORCPT ); Tue, 5 Apr 2016 17:49:53 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36365 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760285AbcDEVtw (ORCPT ); Tue, 5 Apr 2016 17:49:52 -0400 Date: Tue, 5 Apr 2016 14:49:49 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , Minchan Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 21/31] huge tmpfs: show page team flag in pageflags In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andres Lagar-Cavilla For debugging and testing. Signed-off-by: Andres Lagar-Cavilla Signed-off-by: Hugh Dickins --- This patchset has been based on v4.6-rc2: here we get a clash with the addition of KPF_MOVABLE in current mmotm, not hard to fix up. Documentation/vm/pagemap.txt | 2 ++ fs/proc/page.c | 6 ++++++ include/uapi/linux/kernel-page-flags.h | 3 ++- tools/vm/page-types.c | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) --- a/Documentation/vm/pagemap.txt +++ b/Documentation/vm/pagemap.txt @@ -71,6 +71,8 @@ There are four components to pagemap: 23. BALLOON 24. ZERO_PAGE 25. IDLE + 26. TEAM + 27. TEAM_PMD_MMAP (only if the whole team is mapped as a pmd at least once) * /proc/kpagecgroup. This file contains a 64-bit inode number of the memory cgroup each page is charged to, indexed by PFN. Only available when --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "internal.h" @@ -112,6 +113,11 @@ u64 stable_page_flags(struct page *page) if (PageKsm(page)) u |= 1 << KPF_KSM; + if (PageTeam(page)) { + u |= 1 << KPF_TEAM; + if (page == team_head(page) && team_pmd_mapped(page)) + u |= 1 << KPF_TEAM_PMD_MMAP; + } /* * compound pages: export both head/tail info * they together define a compound page's start/end pos and order --- a/include/uapi/linux/kernel-page-flags.h +++ b/include/uapi/linux/kernel-page-flags.h @@ -34,6 +34,7 @@ #define KPF_BALLOON 23 #define KPF_ZERO_PAGE 24 #define KPF_IDLE 25 - +#define KPF_TEAM 26 +#define KPF_TEAM_PMD_MMAP 27 #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -133,6 +133,8 @@ static const char * const page_flag_name [KPF_BALLOON] = "o:balloon", [KPF_ZERO_PAGE] = "z:zero_page", [KPF_IDLE] = "i:idle_page", + [KPF_TEAM] = "y:team", + [KPF_TEAM_PMD_MMAP] = "Y:team_pmd_mmap", [KPF_RESERVED] = "r:reserved", [KPF_MLOCKED] = "m:mlocked",