Thread (17 messages) 17 messages, 4 authors, 2005-11-09

Re: [PATCH 6/8] Direct Migration V2: Avoid writeback / page_migrate() method

From: Nikita Danilov <hidden>
Date: 2005-11-09 11:01:28
Also in: lkml

Christoph Lameter writes:
 > Migrate a page with buffers without requiring writeback
 > 
 > This introduces a new address space operation migrate_page() that
 > may be used by a filesystem to implement its own version of page migration.
 > 
 > A version is provided that migrates buffers attached to pages. Some
 > filesystems (ext2, ext3, xfs) are modified to utilize this feature.
 > 
 > The swapper address space operation are modified so that a regular
 > migrate_pages() will occur for anonymous pages without writeback
 > (migrate_pages forces every anonymous page to have a swap entry).
 > 
 > V1->V2:
 > - Fix CONFIG_MIGRATION handling
 > 
 > Signed-off-by: Mike Kravetz [off-list ref]
 > Signed-off-by: Christoph Lameter [off-list ref]
 > 
 > Index: linux-2.6.14-mm1/include/linux/fs.h
 > ===================================================================
 > --- linux-2.6.14-mm1.orig/include/linux/fs.h	2005-11-07 11:48:46.000000000 -0800
 > +++ linux-2.6.14-mm1/include/linux/fs.h	2005-11-08 10:18:51.000000000 -0800
 > @@ -332,6 +332,8 @@ struct address_space_operations {
 >  			loff_t offset, unsigned long nr_segs);
 >  	struct page* (*get_xip_page)(struct address_space *, sector_t,
 >  			int);
 > +	/* migrate the contents of a page to the specified target */
 > +	int (*migrate_page) (struct page *, struct page *);
 >  };
 >  
 >  struct backing_dev_info;
 > @@ -1679,6 +1681,12 @@ extern void simple_release_fs(struct vfs
 >  
 >  extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
 >  
 > +#ifdef CONFIG_MIGRATION
 > +extern int buffer_migrate_page(struct page *, struct page *);
 > +#else
 > +#define buffer_migrate_page(a,b) NULL
 > +#endif

Depending on the CONFIG_MIGRATION, the type of buffer_migrate_page(a,b)
expansion is either int or void *, which doesn't look right.

Moreover below you have initializations

        .migrate_page		= buffer_migrate_page,

that wouldn't compile when CONFIG_MIGRATION is not defined (as macro
requires two arguments).

Nikita.

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help