Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105346
b: refs/heads/master
c: 83d1674
h: refs/heads/master
v: v3
  • Loading branch information
Gerald Schaefer authored and Linus Torvalds committed Jul 24, 2008
1 parent c19fbb6 commit 9c33d42
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 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: 9ca908f47bc784c90e17a553ce33e756c73feac4
refs/heads/master: 83d1674a946141c3c59d430e96c224f7937e6158
19 changes: 19 additions & 0 deletions trunk/include/linux/mempolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum {
#include <linux/rbtree.h>
#include <linux/spinlock.h>
#include <linux/nodemask.h>
#include <linux/pagemap.h>

struct mm_struct;

Expand Down Expand Up @@ -220,6 +221,24 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context);
extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
int no_context);
#endif

/* Check if a vma is migratable */
static inline int vma_migratable(struct vm_area_struct *vma)
{
if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
return 0;
/*
* Migration allocates pages in the highest zone. If we cannot
* do so then migration (at least from node to node) is not
* possible.
*/
if (vma->vm_file &&
gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
< policy_zone)
return 0;
return 1;
}

#else

struct mempolicy {};
Expand Down
21 changes: 0 additions & 21 deletions trunk/include/linux/migrate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,10 @@

#include <linux/mm.h>
#include <linux/mempolicy.h>
#include <linux/pagemap.h>

typedef struct page *new_page_t(struct page *, unsigned long private, int **);

#ifdef CONFIG_MIGRATION
/* Check if a vma is migratable */
static inline int vma_migratable(struct vm_area_struct *vma)
{
if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
return 0;
/*
* Migration allocates pages in the highest zone. If we cannot
* do so then migration (at least from node to node) is not
* possible.
*/
if (vma->vm_file &&
gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
< policy_zone)
return 0;
return 1;
}

extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
extern int putback_lru_pages(struct list_head *l);
extern int migrate_page(struct address_space *,
Expand All @@ -39,9 +21,6 @@ extern int migrate_vmas(struct mm_struct *mm,
const nodemask_t *from, const nodemask_t *to,
unsigned long flags);
#else
static inline int vma_migratable(struct vm_area_struct *vma)
{ return 0; }

static inline int isolate_lru_page(struct page *p, struct list_head *list)
{ return -ENOSYS; }
static inline int putback_lru_pages(struct list_head *l) { return 0; }
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ config SPLIT_PTLOCK_CPUS
config MIGRATION
bool "Page migration"
def_bool y
depends on NUMA
depends on NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE
help
Allows the migration of the physical location of pages of processes
while the virtual addresses are not changed. This is useful for
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,6 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
mmput(mm);
return err;
}
#endif

/*
* Call migration functions in the vma_ops that may prepare
Expand All @@ -1093,3 +1092,4 @@ int migrate_vmas(struct mm_struct *mm, const nodemask_t *to,
}
return err;
}
#endif

0 comments on commit 9c33d42

Please sign in to comment.