aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h50
1 files changed, 30 insertions, 20 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bc01fff3aa01..df80e63903b5 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -223,24 +223,27 @@ struct page {
223 * & limit reverse map searches. 223 * & limit reverse map searches.
224 */ 224 */
225 union { 225 union {
226 unsigned long private; /* Mapping-private opaque data: 226 struct {
227 * usually used for buffer_heads 227 unsigned long private; /* Mapping-private opaque data:
228 * if PagePrivate set; used for 228 * usually used for buffer_heads
229 * swp_entry_t if PageSwapCache 229 * if PagePrivate set; used for
230 * When page is free, this indicates 230 * swp_entry_t if PageSwapCache.
231 * order in the buddy system. 231 * When page is free, this
232 */ 232 * indicates order in the buddy
233 * system.
234 */
235 struct address_space *mapping; /* If low bit clear, points to
236 * inode address_space, or NULL.
237 * If page mapped as anonymous
238 * memory, low bit is set, and
239 * it points to anon_vma object:
240 * see PAGE_MAPPING_ANON below.
241 */
242 };
233#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 243#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
234 spinlock_t ptl; 244 spinlock_t ptl;
235#endif 245#endif
236 } u; 246 };
237 struct address_space *mapping; /* If low bit clear, points to
238 * inode address_space, or NULL.
239 * If page mapped as anonymous
240 * memory, low bit is set, and
241 * it points to anon_vma object:
242 * see PAGE_MAPPING_ANON below.
243 */
244 pgoff_t index; /* Our offset within mapping. */ 247 pgoff_t index; /* Our offset within mapping. */
245 struct list_head lru; /* Pageout list, eg. active_list 248 struct list_head lru; /* Pageout list, eg. active_list
246 * protected by zone->lru_lock ! 249 * protected by zone->lru_lock !
@@ -261,8 +264,8 @@ struct page {
261#endif /* WANT_PAGE_VIRTUAL */ 264#endif /* WANT_PAGE_VIRTUAL */
262}; 265};
263 266
264#define page_private(page) ((page)->u.private) 267#define page_private(page) ((page)->private)
265#define set_page_private(page, v) ((page)->u.private = (v)) 268#define set_page_private(page, v) ((page)->private = (v))
266 269
267/* 270/*
268 * FIXME: take this include out, include page-flags.h in 271 * FIXME: take this include out, include page-flags.h in
@@ -308,7 +311,7 @@ struct page {
308 */ 311 */
309#define get_page_testone(p) atomic_inc_and_test(&(p)->_count) 312#define get_page_testone(p) atomic_inc_and_test(&(p)->_count)
310 313
311#define set_page_count(p,v) atomic_set(&(p)->_count, v - 1) 314#define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1)
312#define __put_page(p) atomic_dec(&(p)->_count) 315#define __put_page(p) atomic_dec(&(p)->_count)
313 316
314extern void FASTCALL(__page_cache_release(struct page *)); 317extern void FASTCALL(__page_cache_release(struct page *));
@@ -815,7 +818,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
815 * overflow into the next struct page (as it might with DEBUG_SPINLOCK). 818 * overflow into the next struct page (as it might with DEBUG_SPINLOCK).
816 * When freeing, reset page->mapping so free_pages_check won't complain. 819 * When freeing, reset page->mapping so free_pages_check won't complain.
817 */ 820 */
818#define __pte_lockptr(page) &((page)->u.ptl) 821#define __pte_lockptr(page) &((page)->ptl)
819#define pte_lock_init(_page) do { \ 822#define pte_lock_init(_page) do { \
820 spin_lock_init(__pte_lockptr(_page)); \ 823 spin_lock_init(__pte_lockptr(_page)); \
821} while (0) 824} while (0)
@@ -1036,5 +1039,12 @@ int in_gate_area_no_task(unsigned long addr);
1036/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ 1039/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
1037#define OOM_DISABLE -17 1040#define OOM_DISABLE -17
1038 1041
1042int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
1043 void __user *, size_t *, loff_t *);
1044int shrink_slab(unsigned long scanned, gfp_t gfp_mask,
1045 unsigned long lru_pages);
1046void drop_pagecache(void);
1047void drop_slab(void);
1048
1039#endif /* __KERNEL__ */ 1049#endif /* __KERNEL__ */
1040#endif /* _LINUX_MM_H */ 1050#endif /* _LINUX_MM_H */