From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Danilov MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17265.55057.438316.467289@gargle.gargle.HOWL> Date: Wed, 9 Nov 2005 14:01:37 +0300 Subject: Re: [PATCH 6/8] Direct Migration V2: Avoid writeback / page_migrate() method In-Reply-To: <20051108210417.31330.72381.sendpatchset@schroedinger.engr.sgi.com> References: <20051108210246.31330.61756.sendpatchset@schroedinger.engr.sgi.com> <20051108210417.31330.72381.sendpatchset@schroedinger.engr.sgi.com> Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: Mike Kravetz , linux-kernel@vger.kernel.org, Dave Hansen , Nick Piggin , linux-mm@kvack.org, torvalds@osdl.org, Hirokazu Takahashi , Magnus Damm , KAMEZAWA Hiroyuki , Paul Jackson , Marcelo Tosatti , Andi Kleen List-ID: 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 > Signed-off-by: Christoph Lameter > > 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: email@kvack.org