* [PATCH 0/5] Annotation fixes for grouping pages by mobility v2
@ 2007-05-17 10:10 Mel Gorman
2007-05-17 10:10 ` [PATCH 1/5] Mark bio_alloc() allocations correctly Mel Gorman
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:10 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
Changelog since V1
o Added Acks from Christoph Lameter
Hi Andrew,
The following patches deal with annotation fixups and clarifications on
GFP flag usage only. In particular, the last patch in this set fixes the
issue with grow_dev_page() using __GFP_RECLAIMABLE that was brought up
yesterday. Please merge.
Thanks
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/5] Mark bio_alloc() allocations correctly
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
@ 2007-05-17 10:10 ` Mel Gorman
2007-05-17 10:11 ` [PATCH 2/5] Do not annotate shmem allocations explicitly Mel Gorman
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:10 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
bio_alloc() currently uses __GFP_MOVABLE which is plain wrong. Objects are
allocated with that gfp mask via mempool. The slab that is ultimatly used
is not reclaimable or movable.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-clean/fs/buffer.c linux-2.6.22-rc1-mm1-010_biomovable/fs/buffer.c
--- linux-2.6.22-rc1-mm1-clean/fs/buffer.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-010_biomovable/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
@@ -2641,7 +2641,7 @@ int submit_bh(int rw, struct buffer_head
* from here on down, it's all bio -- do the initial mapping,
* submit_bio -> generic_make_request may further map this bio around
*/
- bio = bio_alloc(GFP_NOIO|__GFP_MOVABLE, 1);
+ bio = bio_alloc(GFP_NOIO, 1);
bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
bio->bi_bdev = bh->b_bdev;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/5] Do not annotate shmem allocations explicitly
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
2007-05-17 10:10 ` [PATCH 1/5] Mark bio_alloc() allocations correctly Mel Gorman
@ 2007-05-17 10:11 ` Mel Gorman
2007-05-17 10:11 ` [PATCH 3/5] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:11 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
shmem support allocates pages for two purposes. Firstly, shmem_dir_alloc()
allocates pages to track swap vectors. These are not movable so this
patch clears all mobility-flags related to the allocation. Secondly,
shmem_alloc_pages() allocates pages on behalf of shmem_getpage(), whose
flags come from a file mapping which already sets the appropriate mobility
flags. These allocations do not need to be explicitly flagged so this patch
removes the unnecessary annotations.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
shmem.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-010_biomovable/mm/shmem.c linux-2.6.22-rc1-mm1-012_shmem/mm/shmem.c
--- linux-2.6.22-rc1-mm1-010_biomovable/mm/shmem.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-012_shmem/mm/shmem.c 2007-05-16 23:02:37.000000000 +0100
@@ -96,9 +96,9 @@ static inline struct page *shmem_dir_all
* BLOCKS_PER_PAGE on indirect pages, assume PAGE_CACHE_SIZE:
* might be reconsidered if it ever diverges from PAGE_SIZE.
*
- * __GFP_MOVABLE is masked out as swap vectors cannot move
+ * Mobility flags are masked out as swap vectors cannot move
*/
- return alloc_pages((gfp_mask & ~__GFP_MOVABLE) | __GFP_ZERO,
+ return alloc_pages((gfp_mask & ~GFP_MOVABLE_MASK) | __GFP_ZERO,
PAGE_CACHE_SHIFT-PAGE_SHIFT);
}
@@ -1054,9 +1054,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem
pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx);
pvma.vm_pgoff = idx;
pvma.vm_end = PAGE_SIZE;
- page = alloc_page_vma(
- set_migrateflags(gfp | __GFP_ZERO, __GFP_RECLAIMABLE),
- &pvma, 0);
+ page = alloc_page_vma(gfp | __GFP_ZERO, &pvma, 0);
mpol_free(pvma.vm_policy);
return page;
}
@@ -1076,8 +1074,7 @@ shmem_swapin(struct shmem_inode_info *in
static inline struct page *
shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx)
{
- return alloc_page(
- set_migrateflags(gfp | __GFP_ZERO, __GFP_RECLAIMABLE));
+ return alloc_page(gfp | __GFP_ZERO);
}
#endif
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/5] Add __GFP_TEMPORARY to identify allocations that are short-lived
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
2007-05-17 10:10 ` [PATCH 1/5] Mark bio_alloc() allocations correctly Mel Gorman
2007-05-17 10:11 ` [PATCH 2/5] Do not annotate shmem allocations explicitly Mel Gorman
@ 2007-05-17 10:11 ` Mel Gorman
2007-05-17 10:11 ` [PATCH 4/5] Rename GFP_HIGH_MOVABLE to GFP_HIGHUSER_MOVABLE Mel Gorman
2007-05-17 10:12 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
4 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:11 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
Currently allocations that are short-lived or reclaimable by the kernel are
grouped together by specifying __GFP_RECLAIMABLE in the GFP flags. However,
it is confusing when reading code to see a temporary allocation using
__GFP_RECLAIMABLE when it is clearly not reclaimable.
This patch adds __GFP_TEMPORARY, GFP_TEMPORARY and SLAB_TEMPORARY for
temporary allocations. The journal_handle, journal_head, revoke_table,
revoke_record, skbuff_head_cache and skbuff_fclone_cache slabs are converted
to use SLAB_TEMPORARY instead of flagging the allocation call-sites. In the
implementation, reclaimable and temporary allocations are grouped into the
same blocks but this might change in the future. This change makes call
sites for temporary allocations clearer. Not all temporary allocations
were previously flagged. This patch flags a few additional allocations
appropriately.
Note that some GFP_USER and GFP_KERNEL allocations are both changed to
GFP_TEMPORARY. The difference between GFP_USER and GFP_KERNEL is only in how
cpuset boundaries are handled which is unimportant to temporary allocations.
This patch can be considered as fix to
group-short-lived-and-reclaimable-kernel-allocations.patch.
Credit goes to Christoph Lameter for identifying the problems in relation to
temporary allocations during review and providing an illustration-of-concept
patch to act as a starting point.
[clameter@sgi.com: patch framework]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
drivers/block/acsi_slm.c | 2 +-
fs/jbd/journal.c | 10 ++++------
fs/jbd/revoke.c | 14 ++++++++------
fs/proc/base.c | 12 ++++++------
fs/proc/generic.c | 2 +-
include/linux/gfp.h | 2 ++
include/linux/slab.h | 4 +++-
kernel/cpuset.c | 2 +-
mm/slub.c | 2 +-
net/core/skbuff.c | 19 +++++++++----------
10 files changed, 36 insertions(+), 33 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/drivers/block/acsi_slm.c linux-2.6.22-rc1-mm1-020_temporary/drivers/block/acsi_slm.c
--- linux-2.6.22-rc1-mm1-012_shmem/drivers/block/acsi_slm.c 2007-05-13 02:45:56.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/drivers/block/acsi_slm.c 2007-05-16 23:04:06.000000000 +0100
@@ -367,7 +367,7 @@ static ssize_t slm_read( struct file *fi
int length;
int end;
- if (!(page = __get_free_page( GFP_KERNEL )))
+ if (!(page = __get_free_page(GFP_TEMPORARY)))
return( -ENOMEM );
length = slm_getstats( (char *)page, iminor(node) );
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/fs/jbd/journal.c linux-2.6.22-rc1-mm1-020_temporary/fs/jbd/journal.c
--- linux-2.6.22-rc1-mm1-012_shmem/fs/jbd/journal.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/fs/jbd/journal.c 2007-05-16 23:04:06.000000000 +0100
@@ -1710,7 +1710,7 @@ static int journal_init_journal_head_cac
journal_head_cache = kmem_cache_create("journal_head",
sizeof(struct journal_head),
0, /* offset */
- 0, /* flags */
+ SLAB_TEMPORARY, /* flags */
NULL, /* ctor */
NULL); /* dtor */
retval = 0;
@@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
#ifdef CONFIG_JBD_DEBUG
atomic_inc(&nr_journal_heads);
#endif
- ret = kmem_cache_alloc(journal_head_cache,
- set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
+ ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
if (ret == 0) {
jbd_debug(1, "out of memory for journal_head\n");
if (time_after(jiffies, last_warning + 5*HZ)) {
@@ -1750,8 +1749,7 @@ static struct journal_head *journal_allo
}
while (ret == 0) {
yield();
- ret = kmem_cache_alloc(journal_head_cache,
- GFP_NOFS|__GFP_RECLAIMABLE);
+ ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
}
}
return ret;
@@ -2017,7 +2015,7 @@ static int __init journal_init_handle_ca
jbd_handle_cache = kmem_cache_create("journal_handle",
sizeof(handle_t),
0, /* offset */
- 0, /* flags */
+ SLAB_TEMPORARY, /* flags */
NULL, /* ctor */
NULL); /* dtor */
if (jbd_handle_cache == NULL) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/fs/jbd/revoke.c linux-2.6.22-rc1-mm1-020_temporary/fs/jbd/revoke.c
--- linux-2.6.22-rc1-mm1-012_shmem/fs/jbd/revoke.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/fs/jbd/revoke.c 2007-05-16 23:04:06.000000000 +0100
@@ -169,13 +169,17 @@ int __init journal_init_revoke_caches(vo
{
revoke_record_cache = kmem_cache_create("revoke_record",
sizeof(struct jbd_revoke_record_s),
- 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+ 0,
+ SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
+ NULL, NULL);
if (revoke_record_cache == 0)
return -ENOMEM;
revoke_table_cache = kmem_cache_create("revoke_table",
sizeof(struct jbd_revoke_table_s),
- 0, 0, NULL, NULL);
+ 0,
+ SLAB_TEMPORARY,
+ NULL, NULL);
if (revoke_table_cache == 0) {
kmem_cache_destroy(revoke_record_cache);
revoke_record_cache = NULL;
@@ -205,8 +209,7 @@ int journal_init_revoke(journal_t *journ
while((tmp >>= 1UL) != 0UL)
shift++;
- journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache,
- GFP_KERNEL|__GFP_RECLAIMABLE);
+ journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
if (!journal->j_revoke_table[0])
return -ENOMEM;
journal->j_revoke = journal->j_revoke_table[0];
@@ -229,8 +232,7 @@ int journal_init_revoke(journal_t *journ
for (tmp = 0; tmp < hash_size; tmp++)
INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
- journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache,
- GFP_KERNEL|__GFP_RECLAIMABLE);
+ journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
if (!journal->j_revoke_table[1]) {
kfree(journal->j_revoke_table[0]->hash_table);
kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]);
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/fs/proc/base.c linux-2.6.22-rc1-mm1-020_temporary/fs/proc/base.c
--- linux-2.6.22-rc1-mm1-012_shmem/fs/proc/base.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/fs/proc/base.c 2007-05-16 23:04:06.000000000 +0100
@@ -487,7 +487,7 @@ static ssize_t proc_info_read(struct fil
count = PROC_BLOCK_SIZE;
length = -ENOMEM;
- if (!(page = __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+ if (!(page = __get_free_page(GFP_TEMPORARY)))
goto out;
length = PROC_I(inode)->op.proc_read(task, (char*)page);
@@ -527,7 +527,7 @@ static ssize_t mem_read(struct file * fi
goto out;
ret = -ENOMEM;
- page = (char *)__get_free_page(GFP_USER);
+ page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out;
@@ -597,7 +597,7 @@ static ssize_t mem_write(struct file * f
goto out;
copied = -ENOMEM;
- page = (char *)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+ page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out;
@@ -747,7 +747,7 @@ static ssize_t proc_loginuid_write(struc
/* No partial writes. */
return -EINVAL;
}
- page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+ page = (char*)__get_free_page(GFP_TEMPORARY);
if (!page)
return -ENOMEM;
length = -EFAULT;
@@ -915,7 +915,7 @@ static int do_proc_readlink(struct dentr
char __user *buffer, int buflen)
{
struct inode * inode;
- char *tmp = (char*)__get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE);
+ char *tmp = (char*)__get_free_page(GFP_TEMPORARY);
char *path;
int len;
@@ -1688,7 +1688,7 @@ static ssize_t proc_pid_attr_write(struc
goto out;
length = -ENOMEM;
- page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+ page = (char*)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/fs/proc/generic.c linux-2.6.22-rc1-mm1-020_temporary/fs/proc/generic.c
--- linux-2.6.22-rc1-mm1-012_shmem/fs/proc/generic.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/fs/proc/generic.c 2007-05-16 23:04:06.000000000 +0100
@@ -74,7 +74,7 @@ proc_file_read(struct file *file, char _
nbytes = MAX_NON_LFS - pos;
dp = PDE(inode);
- if (!(page = (char*) __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+ if (!(page = (char*) __get_free_page(GFP_TEMPORARY)))
return -ENOMEM;
while ((nbytes > 0) && !eof) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/include/linux/gfp.h linux-2.6.22-rc1-mm1-020_temporary/include/linux/gfp.h
--- linux-2.6.22-rc1-mm1-012_shmem/include/linux/gfp.h 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/include/linux/gfp.h 2007-05-16 23:04:06.000000000 +0100
@@ -71,6 +71,8 @@ struct vm_area_struct;
#define GFP_NOIO (__GFP_WAIT)
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
+#define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+ __GFP_RECLAIMABLE)
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
__GFP_HIGHMEM)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/include/linux/slab.h linux-2.6.22-rc1-mm1-020_temporary/include/linux/slab.h
--- linux-2.6.22-rc1-mm1-012_shmem/include/linux/slab.h 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/include/linux/slab.h 2007-05-16 23:04:06.000000000 +0100
@@ -26,12 +26,14 @@ typedef struct kmem_cache kmem_cache_t _
#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */
#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */
-#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */
#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */
#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
+/* The following flags affect the page allocator grouping pages by mobility */
+#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
+#define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */
/*
* struct kmem_cache related prototypes
*/
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/kernel/cpuset.c linux-2.6.22-rc1-mm1-020_temporary/kernel/cpuset.c
--- linux-2.6.22-rc1-mm1-012_shmem/kernel/cpuset.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/kernel/cpuset.c 2007-05-16 23:04:06.000000000 +0100
@@ -1383,7 +1383,7 @@ static ssize_t cpuset_common_file_read(s
ssize_t retval = 0;
char *s;
- if (!(page = (char *)__get_free_page(GFP_KERNEL)))
+ if (!(page = (char *)__get_free_page(GFP_TEMPORARY)))
return -ENOMEM;
s = page;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/mm/slub.c linux-2.6.22-rc1-mm1-020_temporary/mm/slub.c
--- linux-2.6.22-rc1-mm1-012_shmem/mm/slub.c 2007-05-16 10:54:19.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/mm/slub.c 2007-05-16 23:04:06.000000000 +0100
@@ -2859,7 +2859,7 @@ static int alloc_loc_track(struct loc_tr
order = get_order(sizeof(struct location) * max);
- l = (void *)__get_free_pages(GFP_KERNEL, order);
+ l = (void *)__get_free_pages(GFP_TEMPORARY, order);
if (!l)
return 0;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-012_shmem/net/core/skbuff.c linux-2.6.22-rc1-mm1-020_temporary/net/core/skbuff.c
--- linux-2.6.22-rc1-mm1-012_shmem/net/core/skbuff.c 2007-05-16 10:54:19.000000000 +0100
+++ linux-2.6.22-rc1-mm1-020_temporary/net/core/skbuff.c 2007-05-16 23:04:06.000000000 +0100
@@ -152,7 +152,6 @@ struct sk_buff *__alloc_skb(unsigned int
u8 *data;
cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
- gfp_mask = set_migrateflags(gfp_mask, __GFP_RECLAIMABLE);
/* Get the HEAD */
skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);
@@ -2002,16 +2001,16 @@ EXPORT_SYMBOL_GPL(skb_segment);
void __init skb_init(void)
{
skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
- sizeof(struct sk_buff),
- 0,
- SLAB_HWCACHE_ALIGN|SLAB_PANIC,
- NULL, NULL);
+ sizeof(struct sk_buff),
+ 0,
+ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_TEMPORARY,
+ NULL, NULL);
skbuff_fclone_cache = kmem_cache_create("skbuff_fclone_cache",
- (2*sizeof(struct sk_buff)) +
- sizeof(atomic_t),
- 0,
- SLAB_HWCACHE_ALIGN|SLAB_PANIC,
- NULL, NULL);
+ (2*sizeof(struct sk_buff)) +
+ sizeof(atomic_t),
+ 0,
+ SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_TEMPORARY,
+ NULL, NULL);
}
/**
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 4/5] Rename GFP_HIGH_MOVABLE to GFP_HIGHUSER_MOVABLE
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
` (2 preceding siblings ...)
2007-05-17 10:11 ` [PATCH 3/5] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
@ 2007-05-17 10:11 ` Mel Gorman
2007-05-17 10:12 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
4 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:11 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
__GFP_HIGH are used to flag allocations that can access emergency
pools. GFP_HIGH_MOVABLE has little to do with __GFP_HIGH and the name is
misleading. This patch renames GFP_HIGH_MOVABLE to GFP_HIGHUSER_MOVABLE so
that it is clearer.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
fs/inode.c | 6 +++---
include/linux/gfp.h | 2 +-
mm/hugetlb.c | 2 +-
mm/memory.c | 5 +++--
mm/mempolicy.c | 5 +++--
mm/migrate.c | 3 ++-
mm/page_alloc.c | 2 +-
mm/swap_prefetch.c | 2 +-
mm/swap_state.c | 3 ++-
9 files changed, 17 insertions(+), 13 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/fs/inode.c linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c
--- linux-2.6.22-rc1-mm1-020_temporary/fs/inode.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c 2007-05-16 23:05:45.000000000 +0100
@@ -154,7 +154,7 @@ static struct inode *alloc_inode(struct
mapping->a_ops = &empty_aops;
mapping->host = inode;
mapping->flags = 0;
- mapping_set_gfp_mask(mapping, GFP_HIGH_MOVABLE);
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE);
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
@@ -535,8 +535,8 @@ repeat:
* @sb: superblock
*
* Allocates a new inode for given superblock. The default gfp_mask
- * for allocations related to inode->i_mapping is GFP_HIGH_MOVABLE. If
- * HIGHMEM pages are unsuitable or it is known that pages allocated
+ * for allocations related to inode->i_mapping is GFP_HIGHUSER_MOVABLE.
+ * If HIGHMEM pages are unsuitable or it is known that pages allocated
* for the page cache are not reclaimable or migratable,
* mapping_set_gfp_mask() must be called with suitable flags on the
* newly created inode's mapping
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/include/linux/gfp.h linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h
--- linux-2.6.22-rc1-mm1-020_temporary/include/linux/gfp.h 2007-05-16 23:04:06.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h 2007-05-16 23:05:45.000000000 +0100
@@ -76,7 +76,7 @@ struct vm_area_struct;
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
__GFP_HIGHMEM)
-#define GFP_HIGH_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
__GFP_HARDWALL | __GFP_HIGHMEM | \
__GFP_MOVABLE)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/hugetlb.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/hugetlb.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/hugetlb.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/hugetlb.c 2007-05-16 23:05:45.000000000 +0100
@@ -267,7 +267,7 @@ int hugetlb_treat_movable_handler(struct
{
proc_dointvec(table, write, file, buffer, length, ppos);
if (hugepages_treat_as_movable)
- htlb_alloc_mask = GFP_HIGH_MOVABLE;
+ htlb_alloc_mask = GFP_HIGHUSER_MOVABLE;
else
htlb_alloc_mask = GFP_HIGHUSER;
return 0;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/memory.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/memory.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/memory.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/memory.c 2007-05-16 23:05:45.000000000 +0100
@@ -1746,7 +1746,7 @@ gotten:
if (!new_page)
goto oom;
} else {
- new_page = alloc_page_vma(GFP_HIGH_MOVABLE, vma, address);
+ new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address);
if (!new_page)
goto oom;
cow_user_page(new_page, old_page, address, vma);
@@ -2392,7 +2392,8 @@ static int __do_fault(struct mm_struct *
fdata.type = VM_FAULT_OOM;
goto out;
}
- page = alloc_page_vma(GFP_HIGH_MOVABLE, vma, address);
+ page = alloc_page_vma(GFP_HIGHUSER_MOVABLE,
+ vma, address);
if (!page) {
fdata.type = VM_FAULT_OOM;
goto out;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/mempolicy.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/mempolicy.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/mempolicy.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/mempolicy.c 2007-05-16 23:05:45.000000000 +0100
@@ -594,7 +594,7 @@ static void migrate_page_add(struct page
static struct page *new_node_page(struct page *page, unsigned long node, int **x)
{
- return alloc_pages_node(node, GFP_HIGH_MOVABLE, 0);
+ return alloc_pages_node(node, GFP_HIGHUSER_MOVABLE, 0);
}
/*
@@ -710,7 +710,8 @@ static struct page *new_vma_page(struct
{
struct vm_area_struct *vma = (struct vm_area_struct *)private;
- return alloc_page_vma(GFP_HIGH_MOVABLE, vma, page_address_in_vma(page, vma));
+ return alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
+ page_address_in_vma(page, vma));
}
#else
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/migrate.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/migrate.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/migrate.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/migrate.c 2007-05-16 23:05:45.000000000 +0100
@@ -761,7 +761,8 @@ static struct page *new_page_node(struct
*result = &pm->status;
- return alloc_pages_node(pm->node, GFP_HIGH_MOVABLE | GFP_THISNODE, 0);
+ return alloc_pages_node(pm->node,
+ GFP_HIGHUSER_MOVABLE | GFP_THISNODE, 0);
}
/*
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/page_alloc.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/page_alloc.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/page_alloc.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/page_alloc.c 2007-05-16 23:05:46.000000000 +0100
@@ -1844,7 +1844,7 @@ unsigned int nr_free_buffer_pages(void)
*/
unsigned int nr_free_pagecache_pages(void)
{
- return nr_free_zone_pages(gfp_zone(GFP_HIGH_MOVABLE));
+ return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE));
}
static inline void show_node(struct zone *zone)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/swap_prefetch.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/swap_prefetch.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/swap_prefetch.c 2007-05-16 10:54:19.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/swap_prefetch.c 2007-05-16 23:05:46.000000000 +0100
@@ -208,7 +208,7 @@ static enum trickle_return trickle_swap_
* Get a new page to read from swap. We have already checked the
* watermarks so __alloc_pages will not call on reclaim.
*/
- page = alloc_pages_node(node, GFP_HIGH_MOVABLE & ~__GFP_WAIT, 0);
+ page = alloc_pages_node(node, GFP_HIGHUSER_MOVABLE & ~__GFP_WAIT, 0);
if (unlikely(!page)) {
ret = TRICKLE_DELAY;
goto out;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-020_temporary/mm/swap_state.c linux-2.6.22-rc1-mm1-025_gfphighuser/mm/swap_state.c
--- linux-2.6.22-rc1-mm1-020_temporary/mm/swap_state.c 2007-05-16 10:54:19.000000000 +0100
+++ linux-2.6.22-rc1-mm1-025_gfphighuser/mm/swap_state.c 2007-05-16 23:05:46.000000000 +0100
@@ -341,7 +341,8 @@ struct page *read_swap_cache_async(swp_e
* Get a new page to read into from swap.
*/
if (!new_page) {
- new_page = alloc_page_vma(GFP_HIGH_MOVABLE, vma, addr);
+ new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE,
+ vma, addr);
if (!new_page)
break; /* Out of memory */
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
` (3 preceding siblings ...)
2007-05-17 10:11 ` [PATCH 4/5] Rename GFP_HIGH_MOVABLE to GFP_HIGHUSER_MOVABLE Mel Gorman
@ 2007-05-17 10:12 ` Mel Gorman
2007-05-17 19:38 ` Andrew Morton
4 siblings, 1 reply; 11+ messages in thread
From: Mel Gorman @ 2007-05-17 10:12 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm
This patch marks page cache allocations as __GFP_PAGECACHE instead of
__GFP_MOVABLE. To make code easier to read, a set of three GFP flags are
added called GFP_PAGECACHE, GFP_NOFS_PAGECACHE and GFP_HIGHUSER_PAGECACHE.
grow_dev_page() is changed to use GFP_NOFS_PAGECACHE instead of
__GFP_RECLAIMABLE. Marking them as __GFP_RECLAIMABLE was a mistake as
they should be grouped with other pagecache pages. bdget() no longer uses
mobility flags after this patch because it is does not appear that any pages
allocated on behalf of the mapping are movable so it needs to be revisited
separately. The allocations required for radix trees are still treated as
RECLAIMABLE after this patch is applied.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
fs/block_dev.c | 2 +-
fs/buffer.c | 2 +-
fs/inode.c | 4 ++--
include/linux/gfp.h | 6 ++++++
4 files changed, 10 insertions(+), 4 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c 2007-05-16 23:07:30.000000000 +0100
@@ -576,7 +576,7 @@ struct block_device *bdget(dev_t dev)
inode->i_rdev = dev;
inode->i_bdev = bdev;
inode->i_data.a_ops = &def_blk_aops;
- mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE);
+ mapping_set_gfp_mask(&inode->i_data, GFP_USER);
inode->i_data.backing_dev_info = &default_backing_dev_info;
spin_lock(&bdev_lock);
list_add(&bdev->bd_list, &all_bdevs);
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
@@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
struct buffer_head *bh;
page = find_or_create_page(inode->i_mapping, index,
- GFP_NOFS|__GFP_RECLAIMABLE);
+ GFP_NOFS_PAGECACHE);
if (!page)
return NULL;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/inode.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c 2007-05-16 23:05:45.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/inode.c 2007-05-16 23:07:30.000000000 +0100
@@ -154,7 +154,7 @@ static struct inode *alloc_inode(struct
mapping->a_ops = &empty_aops;
mapping->host = inode;
mapping->flags = 0;
- mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE);
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
@@ -535,7 +535,7 @@ repeat:
* @sb: superblock
*
* Allocates a new inode for given superblock. The default gfp_mask
- * for allocations related to inode->i_mapping is GFP_HIGHUSER_MOVABLE.
+ * for allocations related to inode->i_mapping is GFP_HIGHUSER_PAGECACHE.
* If HIGHMEM pages are unsuitable or it is known that pages allocated
* for the page cache are not reclaimable or migratable,
* mapping_set_gfp_mask() must be called with suitable flags on the
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h linux-2.6.22-rc1-mm1-030_pagecache_mark/include/linux/gfp.h
--- linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h 2007-05-16 23:05:45.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/include/linux/gfp.h 2007-05-16 23:07:30.000000000 +0100
@@ -79,6 +79,12 @@ struct vm_area_struct;
#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
__GFP_HARDWALL | __GFP_HIGHMEM | \
__GFP_MOVABLE)
+#define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE)
+#define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+ __GFP_HARDWALL | __GFP_MOVABLE)
+#define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+ __GFP_HARDWALL | __GFP_HIGHMEM | \
+ __GFP_MOVABLE)
#ifdef CONFIG_NUMA
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-17 10:12 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
@ 2007-05-17 19:38 ` Andrew Morton
2007-05-18 9:23 ` Mel Gorman
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2007-05-17 19:38 UTC (permalink / raw)
To: Mel Gorman; +Cc: linux-kernel, linux-mm
On Thu, 17 May 2007 11:12:03 +0100 (IST)
Mel Gorman <mel@csn.ul.ie> wrote:
> --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
> +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
> @@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
> struct buffer_head *bh;
>
> page = find_or_create_page(inode->i_mapping, index,
> - GFP_NOFS|__GFP_RECLAIMABLE);
> + GFP_NOFS_PAGECACHE);
> if (!page)
> return NULL;
>
I ended up with
page = find_or_create_page(inode->i_mapping, index,
(mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
here.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-17 19:38 ` Andrew Morton
@ 2007-05-18 9:23 ` Mel Gorman
0 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-18 9:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-mm
On Thu, 17 May 2007, Andrew Morton wrote:
> On Thu, 17 May 2007 11:12:03 +0100 (IST)
> Mel Gorman <mel@csn.ul.ie> wrote:
>
>> --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
>> +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
>> @@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
>> struct buffer_head *bh;
>>
>> page = find_or_create_page(inode->i_mapping, index,
>> - GFP_NOFS|__GFP_RECLAIMABLE);
>> + GFP_NOFS_PAGECACHE);
>> if (!page)
>> return NULL;
>>
>
> I ended up with
>
> page = find_or_create_page(inode->i_mapping, index,
> (mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
>
> here.
>
That looks like it'll work fine with respects to grouping by mobility but
there is a slight functional difference worth noting. Specifically, the
old code did not obey cpuset limits because __GFP_HARDWALL was not set.
This change gets it's GFP mask from bdget() calling mapping_set_gfp_mask()
which is GFP_USER and so will obey CPUSET limits. This new version looks
more correct.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-16 23:14 ` Christoph Lameter
@ 2007-05-16 23:19 ` Mel Gorman
0 siblings, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2007-05-16 23:19 UTC (permalink / raw)
To: Christoph Lameter; +Cc: akpm, linux-mm
On (16/05/07 16:14), Christoph Lameter didst pronounce:
> On Thu, 17 May 2007, Mel Gorman wrote:
>
> > diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c
> > --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c 2007-05-16 10:54:18.000000000 +0100
> > +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c 2007-05-16 23:07:30.000000000 +0100
> > @@ -576,7 +576,7 @@ struct block_device *bdget(dev_t dev)
> > inode->i_rdev = dev;
> > inode->i_bdev = bdev;
> > inode->i_data.a_ops = &def_blk_aops;
> > - mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE);
> > + mapping_set_gfp_mask(&inode->i_data, GFP_USER);
> > inode->i_data.backing_dev_info = &default_backing_dev_info;
> > spin_lock(&bdev_lock);
> > list_add(&bdev->bd_list, &all_bdevs);
> > diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c
> > --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
> > +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
> > @@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
> > struct buffer_head *bh;
> >
> > page = find_or_create_page(inode->i_mapping, index,
> > - GFP_NOFS|__GFP_RECLAIMABLE);
> > + GFP_NOFS_PAGECACHE);
> > if (!page)
> > return NULL;
> >
>
> We still have the contrast here. Should fs/block_dev.c not have
> GFP_PAGECACHE?
It's not clear where, if anywhere, that pages allocated using the
mapping_set_gfp_mask() from bdget() end up on an LRU or become otherwise
movable. Hence, I removed the flag until such time as I am sure.
> But you could leave it and then my patch could fix this
> up.
>
Perfect.
> Otherwise
>
> Acked-by: Christoph Lameter <clameter@sgi.com>
Thanks.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-16 23:02 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
@ 2007-05-16 23:14 ` Christoph Lameter
2007-05-16 23:19 ` Mel Gorman
0 siblings, 1 reply; 11+ messages in thread
From: Christoph Lameter @ 2007-05-16 23:14 UTC (permalink / raw)
To: Mel Gorman; +Cc: akpm, linux-mm
On Thu, 17 May 2007, Mel Gorman wrote:
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c
> --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c 2007-05-16 10:54:18.000000000 +0100
> +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c 2007-05-16 23:07:30.000000000 +0100
> @@ -576,7 +576,7 @@ struct block_device *bdget(dev_t dev)
> inode->i_rdev = dev;
> inode->i_bdev = bdev;
> inode->i_data.a_ops = &def_blk_aops;
> - mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE);
> + mapping_set_gfp_mask(&inode->i_data, GFP_USER);
> inode->i_data.backing_dev_info = &default_backing_dev_info;
> spin_lock(&bdev_lock);
> list_add(&bdev->bd_list, &all_bdevs);
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c
> --- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
> +++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
> @@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
> struct buffer_head *bh;
>
> page = find_or_create_page(inode->i_mapping, index,
> - GFP_NOFS|__GFP_RECLAIMABLE);
> + GFP_NOFS_PAGECACHE);
> if (!page)
> return NULL;
>
We still have the contrast here. Should fs/block_dev.c not have
GFP_PAGECACHE? But you could leave it and then my patch could fix this
up.
Otherwise
Acked-by: Christoph Lameter <clameter@sgi.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE
2007-05-16 23:01 [PATCH 0/5] Annotation fixes for grouping pages by mobility Mel Gorman
@ 2007-05-16 23:02 ` Mel Gorman
2007-05-16 23:14 ` Christoph Lameter
0 siblings, 1 reply; 11+ messages in thread
From: Mel Gorman @ 2007-05-16 23:02 UTC (permalink / raw)
To: clameter; +Cc: Mel Gorman, akpm, linux-mm
This patch marks page cache allocations as __GFP_PAGECACHE instead of
__GFP_MOVABLE. To make code easier to read, a set of three GFP flags are
added called GFP_PAGECACHE, GFP_NOFS_PAGECACHE and GFP_HIGHUSER_PAGECACHE.
grow_dev_page() is changed to use GFP_NOFS_PAGECACHE instead of
__GFP_RECLAIMABLE. Marking them as __GFP_RECLAIMABLE was a mistake as
they should be grouped with other pagecache pages. bdget() no longer uses
mobility flags after this patch because it is does not appear that any pages
allocated on behalf of the mapping are movable so it needs to be revisited
separately. The allocations required for radix trees are still treated as
RECLAIMABLE after this patch is applied.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---
fs/block_dev.c | 2 +-
fs/buffer.c | 2 +-
fs/inode.c | 4 ++--
include/linux/gfp.h | 6 ++++++
4 files changed, 10 insertions(+), 4 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/block_dev.c 2007-05-16 10:54:18.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/block_dev.c 2007-05-16 23:07:30.000000000 +0100
@@ -576,7 +576,7 @@ struct block_device *bdget(dev_t dev)
inode->i_rdev = dev;
inode->i_bdev = bdev;
inode->i_data.a_ops = &def_blk_aops;
- mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE);
+ mapping_set_gfp_mask(&inode->i_data, GFP_USER);
inode->i_data.backing_dev_info = &default_backing_dev_info;
spin_lock(&bdev_lock);
list_add(&bdev->bd_list, &all_bdevs);
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/buffer.c 2007-05-16 22:55:50.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/buffer.c 2007-05-16 23:07:30.000000000 +0100
@@ -1009,7 +1009,7 @@ grow_dev_page(struct block_device *bdev,
struct buffer_head *bh;
page = find_or_create_page(inode->i_mapping, index,
- GFP_NOFS|__GFP_RECLAIMABLE);
+ GFP_NOFS_PAGECACHE);
if (!page)
return NULL;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/inode.c
--- linux-2.6.22-rc1-mm1-025_gfphighuser/fs/inode.c 2007-05-16 23:05:45.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/fs/inode.c 2007-05-16 23:07:30.000000000 +0100
@@ -154,7 +154,7 @@ static struct inode *alloc_inode(struct
mapping->a_ops = &empty_aops;
mapping->host = inode;
mapping->flags = 0;
- mapping_set_gfp_mask(mapping, GFP_HIGHUSER_MOVABLE);
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
@@ -535,7 +535,7 @@ repeat:
* @sb: superblock
*
* Allocates a new inode for given superblock. The default gfp_mask
- * for allocations related to inode->i_mapping is GFP_HIGHUSER_MOVABLE.
+ * for allocations related to inode->i_mapping is GFP_HIGHUSER_PAGECACHE.
* If HIGHMEM pages are unsuitable or it is known that pages allocated
* for the page cache are not reclaimable or migratable,
* mapping_set_gfp_mask() must be called with suitable flags on the
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h linux-2.6.22-rc1-mm1-030_pagecache_mark/include/linux/gfp.h
--- linux-2.6.22-rc1-mm1-025_gfphighuser/include/linux/gfp.h 2007-05-16 23:05:45.000000000 +0100
+++ linux-2.6.22-rc1-mm1-030_pagecache_mark/include/linux/gfp.h 2007-05-16 23:07:30.000000000 +0100
@@ -79,6 +79,12 @@ struct vm_area_struct;
#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
__GFP_HARDWALL | __GFP_HIGHMEM | \
__GFP_MOVABLE)
+#define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE)
+#define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+ __GFP_HARDWALL | __GFP_MOVABLE)
+#define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
+ __GFP_HARDWALL | __GFP_HIGHMEM | \
+ __GFP_MOVABLE)
#ifdef CONFIG_NUMA
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-05-18 9:23 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-17 10:10 [PATCH 0/5] Annotation fixes for grouping pages by mobility v2 Mel Gorman
2007-05-17 10:10 ` [PATCH 1/5] Mark bio_alloc() allocations correctly Mel Gorman
2007-05-17 10:11 ` [PATCH 2/5] Do not annotate shmem allocations explicitly Mel Gorman
2007-05-17 10:11 ` [PATCH 3/5] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
2007-05-17 10:11 ` [PATCH 4/5] Rename GFP_HIGH_MOVABLE to GFP_HIGHUSER_MOVABLE Mel Gorman
2007-05-17 10:12 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
2007-05-17 19:38 ` Andrew Morton
2007-05-18 9:23 ` Mel Gorman
-- strict thread matches above, loose matches on Subject: below --
2007-05-16 23:01 [PATCH 0/5] Annotation fixes for grouping pages by mobility Mel Gorman
2007-05-16 23:02 ` [PATCH 5/5] Mark page cache pages as __GFP_PAGECACHE instead of __GFP_MOVABLE Mel Gorman
2007-05-16 23:14 ` Christoph Lameter
2007-05-16 23:19 ` Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox