Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139163
b: refs/heads/master
c: 33925b2
h: refs/heads/master
i:
  139161: c6dfb69
  139159: 10d8ac5
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 1, 2009
1 parent 43b77d6 commit 7fe726d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ca43e7564679604d86e9ed834e7bbcffd8a4a3f
refs/heads/master: 33925b25d2c00a29664f1994ab350a9bff70f7a2
20 changes: 13 additions & 7 deletions trunk/include/linux/page-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ enum pageflags {
PG_swapbacked, /* Page is backed by RAM/swap */
#ifdef CONFIG_UNEVICTABLE_LRU
PG_unevictable, /* Page is "unevictable" */
#endif
#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
PG_mlocked, /* Page is vma mlocked */
#endif
#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
Expand Down Expand Up @@ -234,20 +236,20 @@ PAGEFLAG_FALSE(SwapCache)
#ifdef CONFIG_UNEVICTABLE_LRU
PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable)
TESTCLEARFLAG(Unevictable, unevictable)
#else
PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable)
SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable)
__CLEARPAGEFLAG_NOOP(Unevictable)
#endif

#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
#define MLOCK_PAGES 1
PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked)
TESTSCFLAG(Mlocked, mlocked)

#else

#define MLOCK_PAGES 0
PAGEFLAG_FALSE(Mlocked)
SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked)

PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable)
SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable)
__CLEARPAGEFLAG_NOOP(Unevictable)
#endif

#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
Expand Down Expand Up @@ -367,9 +369,13 @@ static inline void __ClearPageTail(struct page *page)

#ifdef CONFIG_UNEVICTABLE_LRU
#define __PG_UNEVICTABLE (1 << PG_unevictable)
#define __PG_MLOCKED (1 << PG_mlocked)
#else
#define __PG_UNEVICTABLE 0
#endif

#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
#define __PG_MLOCKED (1 << PG_mlocked)
#else
#define __PG_MLOCKED 0
#endif

Expand Down
8 changes: 8 additions & 0 deletions trunk/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,13 @@ config UNEVICTABLE_LRU
will use one page flag and increase the code size a little,
say Y unless you know what you are doing.

config HAVE_MLOCK
bool
default y if MMU=y

config HAVE_MLOCKED_PAGE_BIT
bool
default y if HAVE_MLOCK=y && UNEVICTABLE_LRU=y

config MMU_NOTIFIER
bool
8 changes: 5 additions & 3 deletions trunk/mm/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static inline unsigned long page_order(struct page *page)
return page_private(page);
}

#ifdef CONFIG_HAVE_MLOCK
extern long mlock_vma_pages_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
extern void munlock_vma_pages_range(struct vm_area_struct *vma,
Expand All @@ -71,6 +72,7 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)
{
munlock_vma_pages_range(vma, vma->vm_start, vma->vm_end);
}
#endif

#ifdef CONFIG_UNEVICTABLE_LRU
/*
Expand All @@ -90,7 +92,7 @@ static inline void unevictable_migrate_page(struct page *new, struct page *old)
}
#endif

#ifdef CONFIG_UNEVICTABLE_LRU
#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
/*
* Called only in fault path via page_evictable() for a new page
* to determine if it's being mapped into a LOCKED vma.
Expand Down Expand Up @@ -165,7 +167,7 @@ static inline void free_page_mlock(struct page *page)
}
}

#else /* CONFIG_UNEVICTABLE_LRU */
#else /* CONFIG_HAVE_MLOCKED_PAGE_BIT */
static inline int is_mlocked_vma(struct vm_area_struct *v, struct page *p)
{
return 0;
Expand All @@ -175,7 +177,7 @@ static inline void mlock_vma_page(struct page *page) { }
static inline void mlock_migrate_page(struct page *new, struct page *old) { }
static inline void free_page_mlock(struct page *page) { }

#endif /* CONFIG_UNEVICTABLE_LRU */
#endif /* CONFIG_HAVE_MLOCKED_PAGE_BIT */

/*
* Return the mem_map entry representing the 'offset' subpage within
Expand Down

0 comments on commit 7fe726d

Please sign in to comment.