aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/page-flags.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-28 11:26:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-28 11:26:12 -0400
commit7a9787e1eba95a166265e6a260cf30af04ef0a99 (patch)
treee730a4565e0318140d2fbd2f0415d18a339d7336 /include/linux/page-flags.h
parent41b9eb264c8407655db57b60b4457fe1b2ec9977 (diff)
parent0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff)
Merge commit 'v2.6.28-rc2' into x86/pci-ioapic-boot-irq-quirks
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r--include/linux/page-flags.h89
1 files changed, 78 insertions, 11 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0d2a4e7012aa..b12f93a3c345 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -93,10 +93,30 @@ enum pageflags {
93 PG_mappedtodisk, /* Has blocks allocated on-disk */ 93 PG_mappedtodisk, /* Has blocks allocated on-disk */
94 PG_reclaim, /* To be reclaimed asap */ 94 PG_reclaim, /* To be reclaimed asap */
95 PG_buddy, /* Page is free, on buddy lists */ 95 PG_buddy, /* Page is free, on buddy lists */
96 PG_swapbacked, /* Page is backed by RAM/swap */
97#ifdef CONFIG_UNEVICTABLE_LRU
98 PG_unevictable, /* Page is "unevictable" */
99 PG_mlocked, /* Page is vma mlocked */
100#endif
96#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR 101#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
97 PG_uncached, /* Page has been mapped as uncached */ 102 PG_uncached, /* Page has been mapped as uncached */
98#endif 103#endif
99 __NR_PAGEFLAGS 104 __NR_PAGEFLAGS,
105
106 /* Filesystems */
107 PG_checked = PG_owner_priv_1,
108
109 /* XEN */
110 PG_pinned = PG_owner_priv_1,
111 PG_savepinned = PG_dirty,
112
113 /* SLOB */
114 PG_slob_page = PG_active,
115 PG_slob_free = PG_private,
116
117 /* SLUB */
118 PG_slub_frozen = PG_active,
119 PG_slub_debug = PG_error,
100}; 120};
101 121
102#ifndef __GENERATING_BOUNDS_H 122#ifndef __GENERATING_BOUNDS_H
@@ -146,21 +166,41 @@ static inline int Page##uname(struct page *page) \
146#define TESTSCFLAG(uname, lname) \ 166#define TESTSCFLAG(uname, lname) \
147 TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) 167 TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname)
148 168
169#define SETPAGEFLAG_NOOP(uname) \
170static inline void SetPage##uname(struct page *page) { }
171
172#define CLEARPAGEFLAG_NOOP(uname) \
173static inline void ClearPage##uname(struct page *page) { }
174
175#define __CLEARPAGEFLAG_NOOP(uname) \
176static inline void __ClearPage##uname(struct page *page) { }
177
178#define TESTCLEARFLAG_FALSE(uname) \
179static inline int TestClearPage##uname(struct page *page) { return 0; }
180
149struct page; /* forward declaration */ 181struct page; /* forward declaration */
150 182
151PAGEFLAG(Locked, locked) TESTSCFLAG(Locked, locked) 183TESTPAGEFLAG(Locked, locked)
152PAGEFLAG(Error, error) 184PAGEFLAG(Error, error)
153PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) 185PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced)
154PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) 186PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty)
155PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) 187PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru)
156PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) 188PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active)
189 TESTCLEARFLAG(Active, active)
157__PAGEFLAG(Slab, slab) 190__PAGEFLAG(Slab, slab)
158PAGEFLAG(Checked, owner_priv_1) /* Used by some filesystems */ 191PAGEFLAG(Checked, checked) /* Used by some filesystems */
159PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */ 192PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */
160PAGEFLAG(SavePinned, dirty); /* Xen */ 193PAGEFLAG(SavePinned, savepinned); /* Xen */
161PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) 194PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved)
162PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) 195PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private)
163 __SETPAGEFLAG(Private, private) 196 __SETPAGEFLAG(Private, private)
197PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked)
198
199__PAGEFLAG(SlobPage, slob_page)
200__PAGEFLAG(SlobFree, slob_free)
201
202__PAGEFLAG(SlubFrozen, slub_frozen)
203__PAGEFLAG(SlubDebug, slub_debug)
164 204
165/* 205/*
166 * Only test-and-set exist for PG_writeback. The unconditional operators are 206 * Only test-and-set exist for PG_writeback. The unconditional operators are
@@ -190,6 +230,25 @@ PAGEFLAG(SwapCache, swapcache)
190PAGEFLAG_FALSE(SwapCache) 230PAGEFLAG_FALSE(SwapCache)
191#endif 231#endif
192 232
233#ifdef CONFIG_UNEVICTABLE_LRU
234PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable)
235 TESTCLEARFLAG(Unevictable, unevictable)
236
237#define MLOCK_PAGES 1
238PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked)
239 TESTSCFLAG(Mlocked, mlocked)
240
241#else
242
243#define MLOCK_PAGES 0
244PAGEFLAG_FALSE(Mlocked)
245 SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked)
246
247PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable)
248 SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable)
249 __CLEARPAGEFLAG_NOOP(Unevictable)
250#endif
251
193#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR 252#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
194PAGEFLAG(Uncached, uncached) 253PAGEFLAG(Uncached, uncached)
195#else 254#else
@@ -218,9 +277,6 @@ static inline void __SetPageUptodate(struct page *page)
218{ 277{
219 smp_wmb(); 278 smp_wmb();
220 __set_bit(PG_uptodate, &(page)->flags); 279 __set_bit(PG_uptodate, &(page)->flags);
221#ifdef CONFIG_S390
222 page_clear_dirty(page);
223#endif
224} 280}
225 281
226static inline void SetPageUptodate(struct page *page) 282static inline void SetPageUptodate(struct page *page)
@@ -308,15 +364,25 @@ static inline void __ClearPageTail(struct page *page)
308 364
309#endif /* !PAGEFLAGS_EXTENDED */ 365#endif /* !PAGEFLAGS_EXTENDED */
310 366
367#ifdef CONFIG_UNEVICTABLE_LRU
368#define __PG_UNEVICTABLE (1 << PG_unevictable)
369#define __PG_MLOCKED (1 << PG_mlocked)
370#else
371#define __PG_UNEVICTABLE 0
372#define __PG_MLOCKED 0
373#endif
374
311#define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ 375#define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \
312 1 << PG_buddy | 1 << PG_writeback | \ 376 1 << PG_buddy | 1 << PG_writeback | \
313 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active) 377 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \
378 __PG_UNEVICTABLE | __PG_MLOCKED)
314 379
315/* 380/*
316 * Flags checked in bad_page(). Pages on the free list should not have 381 * Flags checked in bad_page(). Pages on the free list should not have
317 * these flags set. It they are, there is a problem. 382 * these flags set. It they are, there is a problem.
318 */ 383 */
319#define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | 1 << PG_reclaim | 1 << PG_dirty) 384#define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | \
385 1 << PG_reclaim | 1 << PG_dirty | 1 << PG_swapbacked)
320 386
321/* 387/*
322 * Flags checked when a page is freed. Pages being freed should not have 388 * Flags checked when a page is freed. Pages being freed should not have
@@ -329,7 +395,8 @@ static inline void __ClearPageTail(struct page *page)
329 * Pages being prepped should not have these flags set. It they are, there 395 * Pages being prepped should not have these flags set. It they are, there
330 * is a problem. 396 * is a problem.
331 */ 397 */
332#define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | 1 << PG_reserved | 1 << PG_dirty) 398#define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | \
399 1 << PG_reserved | 1 << PG_dirty | 1 << PG_swapbacked)
333 400
334#endif /* !__GENERATING_BOUNDS_H */ 401#endif /* !__GENERATING_BOUNDS_H */
335#endif /* PAGE_FLAGS_H */ 402#endif /* PAGE_FLAGS_H */