Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23416
b: refs/heads/master
c: 44110fe
h: refs/heads/master
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Mar 24, 2006
1 parent 4e729c6 commit 9773de1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 825a46af5ac171f9f41f794a0a00165588ba1589
refs/heads/master: 44110fe385af23ca5eee8a6ad4ff55d50339097a
5 changes: 5 additions & 0 deletions trunk/include/linux/pagemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
#define page_cache_release(page) put_page(page)
void release_pages(struct page **pages, int nr, int cold);

#ifdef CONFIG_NUMA
extern struct page *page_cache_alloc(struct address_space *x);
extern struct page *page_cache_alloc_cold(struct address_space *x);
#else
static inline struct page *page_cache_alloc(struct address_space *x)
{
return alloc_pages(mapping_gfp_mask(x), 0);
Expand All @@ -60,6 +64,7 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x)
{
return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
}
#endif

typedef int filler_t(void *, struct page *);

Expand Down
23 changes: 23 additions & 0 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/blkdev.h>
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/cpuset.h>
#include "filemap.h"
#include "internal.h"

Expand Down Expand Up @@ -427,6 +428,28 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
return ret;
}

#ifdef CONFIG_NUMA
struct page *page_cache_alloc(struct address_space *x)
{
if (cpuset_do_page_mem_spread()) {
int n = cpuset_mem_spread_node();
return alloc_pages_node(n, mapping_gfp_mask(x), 0);
}
return alloc_pages(mapping_gfp_mask(x), 0);
}
EXPORT_SYMBOL(page_cache_alloc);

struct page *page_cache_alloc_cold(struct address_space *x)
{
if (cpuset_do_page_mem_spread()) {
int n = cpuset_mem_spread_node();
return alloc_pages_node(n, mapping_gfp_mask(x)|__GFP_COLD, 0);
}
return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
}
EXPORT_SYMBOL(page_cache_alloc_cold);
#endif

/*
* In order to wait for pages to become available there must be
* waitqueues associated with pages. By using a hash table of
Expand Down

0 comments on commit 9773de1

Please sign in to comment.