-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfix-hugetlb-page-filter.patch
57 lines (47 loc) · 2 KB
/
fix-hugetlb-page-filter.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From [email protected] Sun Jul 31 09:41:55 2005
Date: Sun, 31 Jul 2005 09:41:55 -0700
From: Jason Uhlenkott <[email protected]>
Subject: [PATCH] Fix hugetlb page filtration
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 1623
Lines: 42
The dump filters currently treat hugetlb pages as kernel pages, even
though they only ever contain user data. This can lead to
prohibitively long dump times, especially on large systems which may
have the majority of their memory reserved for use as huge pages.
The following fixes the filters so huge pages which contain user data
(i.e. pages which serve as backing store for hugetlbfs files) get
dumped at DUMP_LEVEL_USED, and free huge pages get dumped at
DUMP_LEVEL_ALL_RAM. This makes the filter semantics the same for
hugetlbfs as they currently are for tmpfs/ramfs.
Index: linux/drivers/dump/dump_filters.c
===================================================================
--- linux.orig/drivers/dump/dump_filters.c 2005-07-30 18:27:38.981401714 -0700
+++ linux/drivers/dump/dump_filters.c 2005-07-31 08:52:40.488230442 -0700
@@ -56,18 +56,21 @@
static inline int kernel_page(struct page *p)
{
- /* FIXME: Need to exclude hugetlb pages. Clue: reserved but inuse */
- return (PageReserved(p) && !PageInuse(p)) || (!PageLRU(p) && PageInuse(p));
+ return (PageReserved(p) && !PageInuse(p)) ||
+ (!PageLRU(p) && !PageCompound(p) && PageInuse(p));
}
static inline int user_page(struct page *p)
{
- return PageInuse(p) && (!PageReserved(p) && PageLRU(p));
+ return PageInuse(p) && !PageReserved(p) &&
+ (PageLRU(p) ||
+ (PageCompound(p) && ((struct page *)p->private)->mapping));
}
static inline int unreferenced_page(struct page *p)
{
- return !PageInuse(p) && !PageReserved(p);
+ return (!PageInuse(p) && !PageReserved(p)) ||
+ (PageCompound(p) && !((struct page *)p->private)->mapping);
}