]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.suse/SoN-07-page_alloc-reserve.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / SoN-07-page_alloc-reserve.patch
1 From: Peter Zijlstra <a.p.zijlstra@chello.nl>
2 Subject: mm: tag reseve pages
3 Patch-mainline: No
4 References: FATE#303834
5
6 Tag pages allocated from the reserves with a non-zero page->reserve.
7 This allows us to distinguish and account reserve pages.
8
9 Since low-memory situations are transient, and unrelated the the actual
10 page (any page can be on the freelist when we run low), don't mark the
11 page in any permanent way - just pass along the information to the
12 allocatee.
13
14 Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
15 Acked-by: Neil Brown <neilb@suse.de>
16 Acked-by: Suresh Jayaraman <sjayaraman@suse.de>
17
18 ---
19 include/linux/mm_types.h | 1 +
20 mm/page_alloc.c | 4 +++-
21 2 files changed, 4 insertions(+), 1 deletion(-)
22
23 --- a/include/linux/mm_types.h
24 +++ b/include/linux/mm_types.h
25 @@ -74,6 +74,7 @@ struct page {
26 union {
27 pgoff_t index; /* Our offset within mapping. */
28 void *freelist; /* SLUB: freelist req. slab lock */
29 + int reserve; /* page_alloc: page is a reserve page */
30 };
31 struct list_head lru; /* Pageout list, eg. active_list
32 * protected by zone->lru_lock !
33 --- a/mm/page_alloc.c
34 +++ b/mm/page_alloc.c
35 @@ -1430,8 +1430,10 @@ zonelist_scan:
36 }
37
38 page = buffered_rmqueue(preferred_zone, zone, order, gfp_mask);
39 - if (page)
40 + if (page) {
41 + page->reserve = !!(alloc_flags & ALLOC_NO_WATERMARKS);
42 break;
43 + }
44 this_zone_full:
45 if (NUMA_BUILD)
46 zlc_mark_zone_full(zonelist, z);