All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-10 16:33 ` Minchan Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-10 16:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Minchan Kim, Miklos Szeredi, Rik van Riel,
	KAMEZAWA Hiroyuki, Mel Gorman

This patch optmizes replace_page_cache_page.

1) remove radix_tree_preload
2) single radix_tree_lookup_slot and replace radix tree slot
3) page accounting optimization if both pages are in same zone.

Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
 mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 51 insertions(+), 10 deletions(-)

Hi Miklos,
This patch is totally not tested.
Could you test this patch?

diff --git a/mm/filemap.c b/mm/filemap.c
index a25c898..918ef1e 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -148,6 +148,56 @@ void __remove_from_page_cache(struct page *page)
 	}
 }
 
+/*
+ * Replace a page from the page cache with a new one.
+ * Both the old and new page must be locked.
+ * The caller must hold the mapping's tree_lock.
+ */
+void __replace_page_cache_page(struct page *old, struct page *new)
+{
+	void **pslot;
+	struct address_space *mapping = old->mapping;
+	struct zone *old_zone, *new_zone;
+
+	old_zone = page_zone(old);
+	new_zone = page_zone(new);
+	/*
+	 * if we're uptodate, flush out into the cleancache, otherwise
+	 * invalidate any existing cleancache entries.  We can't leave
+	 * stale data around in the cleancache once our page is gone
+	 */
+	if (PageUptodate(old))
+		cleancache_put_page(old);
+	else
+		cleancache_flush_page(mapping, old);
+
+	pslot = radix_tree_lookup_slot(&mapping->page_tree,
+			page_index(old));
+	get_page(new);      /* add cache reference */
+	radix_tree_replace_slot(pslot, new);
+	old->mapping = NULL;
+	if (old_zone != new_zone) {
+		__dec_zone_page_state(old, NR_FILE_PAGES);
+		__inc_zone_page_state(new, NR_FILE_PAGES);
+		if (PageSwapBacked(old)) {
+			__dec_zone_page_state(old, NR_SHMEM);
+			__inc_zone_page_state(new, NR_SHMEM);
+		}
+	}
+	BUG_ON(page_mapped(old));
+	/*
+	 * Some filesystems seem to re-dirty the page even after
+	 * the VM has canceled the dirty bit (eg ext3 journaling).
+	 *
+	 * Fix it up by doing a final dirty accounting check after
+	 * having removed the page entirely.
+	 */
+	if (PageDirty(old) && mapping_cap_account_dirty(mapping)) {
+		dec_zone_page_state(old, NR_FILE_DIRTY);
+		dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
+	}
+}
+
 void remove_from_page_cache(struct page *page)
 {
 	struct address_space *mapping = page->mapping;
@@ -433,7 +483,6 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
 	if (error)
 		return error;
 
-	error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
 	if (!error) {
 		struct address_space *mapping = old->mapping;
 		void (*freepage)(struct page *);
@@ -441,20 +490,12 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
 		pgoff_t offset = old->index;
 		freepage = mapping->a_ops->freepage;
 
-		page_cache_get(new);
 		new->mapping = mapping;
 		new->index = offset;
 
 		spin_lock_irq(&mapping->tree_lock);
-		__remove_from_page_cache(old);
-		error = radix_tree_insert(&mapping->page_tree, offset, new);
-		BUG_ON(error);
-		mapping->nrpages++;
-		__inc_zone_page_state(new, NR_FILE_PAGES);
-		if (PageSwapBacked(new))
-			__inc_zone_page_state(new, NR_SHMEM);
+		__replace_page_cache_page(old, new);
 		spin_unlock_irq(&mapping->tree_lock);
-		radix_tree_preload_end();
 		if (freepage)
 			freepage(old);
 		page_cache_release(old);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-10 16:33 ` Minchan Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-10 16:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Minchan Kim, Miklos Szeredi, Rik van Riel,
	KAMEZAWA Hiroyuki, Mel Gorman

This patch optmizes replace_page_cache_page.

1) remove radix_tree_preload
2) single radix_tree_lookup_slot and replace radix tree slot
3) page accounting optimization if both pages are in same zone.

Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
 mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 51 insertions(+), 10 deletions(-)

Hi Miklos,
This patch is totally not tested.
Could you test this patch?

diff --git a/mm/filemap.c b/mm/filemap.c
index a25c898..918ef1e 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -148,6 +148,56 @@ void __remove_from_page_cache(struct page *page)
 	}
 }
 
+/*
+ * Replace a page from the page cache with a new one.
+ * Both the old and new page must be locked.
+ * The caller must hold the mapping's tree_lock.
+ */
+void __replace_page_cache_page(struct page *old, struct page *new)
+{
+	void **pslot;
+	struct address_space *mapping = old->mapping;
+	struct zone *old_zone, *new_zone;
+
+	old_zone = page_zone(old);
+	new_zone = page_zone(new);
+	/*
+	 * if we're uptodate, flush out into the cleancache, otherwise
+	 * invalidate any existing cleancache entries.  We can't leave
+	 * stale data around in the cleancache once our page is gone
+	 */
+	if (PageUptodate(old))
+		cleancache_put_page(old);
+	else
+		cleancache_flush_page(mapping, old);
+
+	pslot = radix_tree_lookup_slot(&mapping->page_tree,
+			page_index(old));
+	get_page(new);      /* add cache reference */
+	radix_tree_replace_slot(pslot, new);
+	old->mapping = NULL;
+	if (old_zone != new_zone) {
+		__dec_zone_page_state(old, NR_FILE_PAGES);
+		__inc_zone_page_state(new, NR_FILE_PAGES);
+		if (PageSwapBacked(old)) {
+			__dec_zone_page_state(old, NR_SHMEM);
+			__inc_zone_page_state(new, NR_SHMEM);
+		}
+	}
+	BUG_ON(page_mapped(old));
+	/*
+	 * Some filesystems seem to re-dirty the page even after
+	 * the VM has canceled the dirty bit (eg ext3 journaling).
+	 *
+	 * Fix it up by doing a final dirty accounting check after
+	 * having removed the page entirely.
+	 */
+	if (PageDirty(old) && mapping_cap_account_dirty(mapping)) {
+		dec_zone_page_state(old, NR_FILE_DIRTY);
+		dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
+	}
+}
+
 void remove_from_page_cache(struct page *page)
 {
 	struct address_space *mapping = page->mapping;
@@ -433,7 +483,6 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
 	if (error)
 		return error;
 
-	error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
 	if (!error) {
 		struct address_space *mapping = old->mapping;
 		void (*freepage)(struct page *);
@@ -441,20 +490,12 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
 		pgoff_t offset = old->index;
 		freepage = mapping->a_ops->freepage;
 
-		page_cache_get(new);
 		new->mapping = mapping;
 		new->index = offset;
 
 		spin_lock_irq(&mapping->tree_lock);
-		__remove_from_page_cache(old);
-		error = radix_tree_insert(&mapping->page_tree, offset, new);
-		BUG_ON(error);
-		mapping->nrpages++;
-		__inc_zone_page_state(new, NR_FILE_PAGES);
-		if (PageSwapBacked(new))
-			__inc_zone_page_state(new, NR_SHMEM);
+		__replace_page_cache_page(old, new);
 		spin_unlock_irq(&mapping->tree_lock);
-		radix_tree_preload_end();
 		if (freepage)
 			freepage(old);
 		page_cache_release(old);
-- 
1.7.1

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
  2011-02-10 16:33 ` Minchan Kim
@ 2011-02-19 23:41   ` Minchan Kim
  -1 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-19 23:41 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Miklos Szeredi, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

Resend.

he patch is based on mmotm-2011-02-04 + 
mm-add-replace_page_cache_page-function-add-freepage-hook.patch.

On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> This patch optmizes replace_page_cache_page.
> 
> 1) remove radix_tree_preload
> 2) single radix_tree_lookup_slot and replace radix tree slot
> 3) page accounting optimization if both pages are in same zone.
> 
> Cc: Miklos Szeredi <mszeredi@suse.cz>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
>  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
>  1 files changed, 51 insertions(+), 10 deletions(-)
> 
> Hi Miklos,
> This patch is totally not tested.
> Could you test this patch?
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a25c898..918ef1e 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -148,6 +148,56 @@ void __remove_from_page_cache(struct page *page)
>  	}
>  }
>  
> +/*
> + * Replace a page from the page cache with a new one.
> + * Both the old and new page must be locked.
> + * The caller must hold the mapping's tree_lock.
> + */
> +void __replace_page_cache_page(struct page *old, struct page *new)
> +{
> +	void **pslot;
> +	struct address_space *mapping = old->mapping;
> +	struct zone *old_zone, *new_zone;
> +
> +	old_zone = page_zone(old);
> +	new_zone = page_zone(new);
> +	/*
> +	 * if we're uptodate, flush out into the cleancache, otherwise
> +	 * invalidate any existing cleancache entries.  We can't leave
> +	 * stale data around in the cleancache once our page is gone
> +	 */
> +	if (PageUptodate(old))
> +		cleancache_put_page(old);
> +	else
> +		cleancache_flush_page(mapping, old);
> +
> +	pslot = radix_tree_lookup_slot(&mapping->page_tree,
> +			page_index(old));
> +	get_page(new);      /* add cache reference */
> +	radix_tree_replace_slot(pslot, new);
> +	old->mapping = NULL;
> +	if (old_zone != new_zone) {
> +		__dec_zone_page_state(old, NR_FILE_PAGES);
> +		__inc_zone_page_state(new, NR_FILE_PAGES);
> +		if (PageSwapBacked(old)) {
> +			__dec_zone_page_state(old, NR_SHMEM);
> +			__inc_zone_page_state(new, NR_SHMEM);
> +		}
> +	}
> +	BUG_ON(page_mapped(old));
> +	/*
> +	 * Some filesystems seem to re-dirty the page even after
> +	 * the VM has canceled the dirty bit (eg ext3 journaling).
> +	 *
> +	 * Fix it up by doing a final dirty accounting check after
> +	 * having removed the page entirely.
> +	 */
> +	if (PageDirty(old) && mapping_cap_account_dirty(mapping)) {
> +		dec_zone_page_state(old, NR_FILE_DIRTY);
> +		dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
> +	}
> +}
> +
>  void remove_from_page_cache(struct page *page)
>  {
>  	struct address_space *mapping = page->mapping;
> @@ -433,7 +483,6 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  	if (error)
>  		return error;
>  
> -	error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
>  	if (!error) {
>  		struct address_space *mapping = old->mapping;
>  		void (*freepage)(struct page *);
> @@ -441,20 +490,12 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  		pgoff_t offset = old->index;
>  		freepage = mapping->a_ops->freepage;
>  
> -		page_cache_get(new);
>  		new->mapping = mapping;
>  		new->index = offset;
>  
>  		spin_lock_irq(&mapping->tree_lock);
> -		__remove_from_page_cache(old);
> -		error = radix_tree_insert(&mapping->page_tree, offset, new);
> -		BUG_ON(error);
> -		mapping->nrpages++;
> -		__inc_zone_page_state(new, NR_FILE_PAGES);
> -		if (PageSwapBacked(new))
> -			__inc_zone_page_state(new, NR_SHMEM);
> +		__replace_page_cache_page(old, new);
>  		spin_unlock_irq(&mapping->tree_lock);
> -		radix_tree_preload_end();
>  		if (freepage)
>  			freepage(old);
>  		page_cache_release(old);
> -- 
> 1.7.1
> 

-- 
Kind regards,
Minchan Kim

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-19 23:41   ` Minchan Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-19 23:41 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Miklos Szeredi, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

Resend.

he patch is based on mmotm-2011-02-04 + 
mm-add-replace_page_cache_page-function-add-freepage-hook.patch.

On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> This patch optmizes replace_page_cache_page.
> 
> 1) remove radix_tree_preload
> 2) single radix_tree_lookup_slot and replace radix tree slot
> 3) page accounting optimization if both pages are in same zone.
> 
> Cc: Miklos Szeredi <mszeredi@suse.cz>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
>  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
>  1 files changed, 51 insertions(+), 10 deletions(-)
> 
> Hi Miklos,
> This patch is totally not tested.
> Could you test this patch?
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a25c898..918ef1e 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -148,6 +148,56 @@ void __remove_from_page_cache(struct page *page)
>  	}
>  }
>  
> +/*
> + * Replace a page from the page cache with a new one.
> + * Both the old and new page must be locked.
> + * The caller must hold the mapping's tree_lock.
> + */
> +void __replace_page_cache_page(struct page *old, struct page *new)
> +{
> +	void **pslot;
> +	struct address_space *mapping = old->mapping;
> +	struct zone *old_zone, *new_zone;
> +
> +	old_zone = page_zone(old);
> +	new_zone = page_zone(new);
> +	/*
> +	 * if we're uptodate, flush out into the cleancache, otherwise
> +	 * invalidate any existing cleancache entries.  We can't leave
> +	 * stale data around in the cleancache once our page is gone
> +	 */
> +	if (PageUptodate(old))
> +		cleancache_put_page(old);
> +	else
> +		cleancache_flush_page(mapping, old);
> +
> +	pslot = radix_tree_lookup_slot(&mapping->page_tree,
> +			page_index(old));
> +	get_page(new);      /* add cache reference */
> +	radix_tree_replace_slot(pslot, new);
> +	old->mapping = NULL;
> +	if (old_zone != new_zone) {
> +		__dec_zone_page_state(old, NR_FILE_PAGES);
> +		__inc_zone_page_state(new, NR_FILE_PAGES);
> +		if (PageSwapBacked(old)) {
> +			__dec_zone_page_state(old, NR_SHMEM);
> +			__inc_zone_page_state(new, NR_SHMEM);
> +		}
> +	}
> +	BUG_ON(page_mapped(old));
> +	/*
> +	 * Some filesystems seem to re-dirty the page even after
> +	 * the VM has canceled the dirty bit (eg ext3 journaling).
> +	 *
> +	 * Fix it up by doing a final dirty accounting check after
> +	 * having removed the page entirely.
> +	 */
> +	if (PageDirty(old) && mapping_cap_account_dirty(mapping)) {
> +		dec_zone_page_state(old, NR_FILE_DIRTY);
> +		dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
> +	}
> +}
> +
>  void remove_from_page_cache(struct page *page)
>  {
>  	struct address_space *mapping = page->mapping;
> @@ -433,7 +483,6 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  	if (error)
>  		return error;
>  
> -	error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
>  	if (!error) {
>  		struct address_space *mapping = old->mapping;
>  		void (*freepage)(struct page *);
> @@ -441,20 +490,12 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  		pgoff_t offset = old->index;
>  		freepage = mapping->a_ops->freepage;
>  
> -		page_cache_get(new);
>  		new->mapping = mapping;
>  		new->index = offset;
>  
>  		spin_lock_irq(&mapping->tree_lock);
> -		__remove_from_page_cache(old);
> -		error = radix_tree_insert(&mapping->page_tree, offset, new);
> -		BUG_ON(error);
> -		mapping->nrpages++;
> -		__inc_zone_page_state(new, NR_FILE_PAGES);
> -		if (PageSwapBacked(new))
> -			__inc_zone_page_state(new, NR_SHMEM);
> +		__replace_page_cache_page(old, new);
>  		spin_unlock_irq(&mapping->tree_lock);
> -		radix_tree_preload_end();
>  		if (freepage)
>  			freepage(old);
>  		page_cache_release(old);
> -- 
> 1.7.1
> 

-- 
Kind regards,
Minchan Kim

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
  2011-02-19 23:41   ` Minchan Kim
@ 2011-02-23 22:44     ` Andrew Morton
  -1 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2011-02-23 22:44 UTC (permalink / raw)
  To: Minchan Kim
  Cc: linux-mm, LKML, Miklos Szeredi, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

On Sun, 20 Feb 2011 08:41:21 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:

> Resend.

Reignore.

> he patch is based on mmotm-2011-02-04 + 
> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> 
> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> > This patch optmizes replace_page_cache_page.
> > 
> > 1) remove radix_tree_preload
> > 2) single radix_tree_lookup_slot and replace radix tree slot
> > 3) page accounting optimization if both pages are in same zone.
> > 
> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> > Cc: Rik van Riel <riel@redhat.com>
> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > Cc: Mel Gorman <mel@csn.ul.ie>
> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> > ---
> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> >  1 files changed, 51 insertions(+), 10 deletions(-)
> > 
> > Hi Miklos,
> > This patch is totally not tested.
> > Could you test this patch?

^^^ Because of this.

Is it tested yet?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-23 22:44     ` Andrew Morton
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2011-02-23 22:44 UTC (permalink / raw)
  To: Minchan Kim
  Cc: linux-mm, LKML, Miklos Szeredi, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

On Sun, 20 Feb 2011 08:41:21 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:

> Resend.

Reignore.

> he patch is based on mmotm-2011-02-04 + 
> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> 
> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> > This patch optmizes replace_page_cache_page.
> > 
> > 1) remove radix_tree_preload
> > 2) single radix_tree_lookup_slot and replace radix tree slot
> > 3) page accounting optimization if both pages are in same zone.
> > 
> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> > Cc: Rik van Riel <riel@redhat.com>
> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > Cc: Mel Gorman <mel@csn.ul.ie>
> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> > ---
> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> >  1 files changed, 51 insertions(+), 10 deletions(-)
> > 
> > Hi Miklos,
> > This patch is totally not tested.
> > Could you test this patch?

^^^ Because of this.

Is it tested yet?

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
  2011-02-23 22:44     ` Andrew Morton
@ 2011-02-23 23:37       ` Minchan Kim
  -1 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-23 23:37 UTC (permalink / raw)
  To: Andrew Morton, Miklos Szeredi
  Cc: linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki, Mel Gorman

On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Sun, 20 Feb 2011 08:41:21 +0900
> Minchan Kim <minchan.kim@gmail.com> wrote:
>
>> Resend.
>
> Reignore.
>
>> he patch is based on mmotm-2011-02-04 +
>> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
>>
>> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
>> > This patch optmizes replace_page_cache_page.
>> >
>> > 1) remove radix_tree_preload
>> > 2) single radix_tree_lookup_slot and replace radix tree slot
>> > 3) page accounting optimization if both pages are in same zone.
>> >
>> > Cc: Miklos Szeredi <mszeredi@suse.cz>
>> > Cc: Rik van Riel <riel@redhat.com>
>> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> > Cc: Mel Gorman <mel@csn.ul.ie>
>> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
>> > ---
>> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
>> >  1 files changed, 51 insertions(+), 10 deletions(-)
>> >
>> > Hi Miklos,
>> > This patch is totally not tested.
>> > Could you test this patch?
>
> ^^^ Because of this.
>
> Is it tested yet?
>

Miklos. Could you test this?
If you are busy, let me know how to test it. I will.
Thanks.


-- 
Kind regards,
Minchan Kim

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-23 23:37       ` Minchan Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Minchan Kim @ 2011-02-23 23:37 UTC (permalink / raw)
  To: Andrew Morton, Miklos Szeredi
  Cc: linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki, Mel Gorman

On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Sun, 20 Feb 2011 08:41:21 +0900
> Minchan Kim <minchan.kim@gmail.com> wrote:
>
>> Resend.
>
> Reignore.
>
>> he patch is based on mmotm-2011-02-04 +
>> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
>>
>> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
>> > This patch optmizes replace_page_cache_page.
>> >
>> > 1) remove radix_tree_preload
>> > 2) single radix_tree_lookup_slot and replace radix tree slot
>> > 3) page accounting optimization if both pages are in same zone.
>> >
>> > Cc: Miklos Szeredi <mszeredi@suse.cz>
>> > Cc: Rik van Riel <riel@redhat.com>
>> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> > Cc: Mel Gorman <mel@csn.ul.ie>
>> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
>> > ---
>> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
>> >  1 files changed, 51 insertions(+), 10 deletions(-)
>> >
>> > Hi Miklos,
>> > This patch is totally not tested.
>> > Could you test this patch?
>
> ^^^ Because of this.
>
> Is it tested yet?
>

Miklos. Could you test this?
If you are busy, let me know how to test it. I will.
Thanks.


-- 
Kind regards,
Minchan Kim

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
  2011-02-23 23:37       ` Minchan Kim
@ 2011-02-24 10:56         ` Miklos Szeredi
  -1 siblings, 0 replies; 12+ messages in thread
From: Miklos Szeredi @ 2011-02-24 10:56 UTC (permalink / raw)
  To: Minchan Kim
  Cc: Andrew Morton, linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

On Thu, 2011-02-24 at 08:37 +0900, Minchan Kim wrote:
> On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Sun, 20 Feb 2011 08:41:21 +0900
> > Minchan Kim <minchan.kim@gmail.com> wrote:
> >
> >> Resend.
> >
> > Reignore.
> >
> >> he patch is based on mmotm-2011-02-04 +
> >> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> >>
> >> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> >> > This patch optmizes replace_page_cache_page.
> >> >
> >> > 1) remove radix_tree_preload
> >> > 2) single radix_tree_lookup_slot and replace radix tree slot
> >> > 3) page accounting optimization if both pages are in same zone.
> >> >
> >> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> >> > Cc: Rik van Riel <riel@redhat.com>
> >> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >> > Cc: Mel Gorman <mel@csn.ul.ie>
> >> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> >> > ---
> >> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> >> >  1 files changed, 51 insertions(+), 10 deletions(-)
> >> >
> >> > Hi Miklos,
> >> > This patch is totally not tested.
> >> > Could you test this patch?
> >
> > ^^^ Because of this.
> >
> > Is it tested yet?
> >
> 
> Miklos. Could you test this?
> If you are busy, let me know how to test it. I will.
> Thanks.

Grab git version of libfuse and do something like this:

 fuse/example/fusexmp_fh -obig_writes /mnt/fuse/
 dd if=/tmp/random0 of=/mnt/fuse/tmp/random1 bs=1M
 md5sum /tmp/radom0 /tmp/random1

This should exercise the page moving.

I'll review and test the patch when I have some time.

Thanks,
Miklos


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
@ 2011-02-24 10:56         ` Miklos Szeredi
  0 siblings, 0 replies; 12+ messages in thread
From: Miklos Szeredi @ 2011-02-24 10:56 UTC (permalink / raw)
  To: Minchan Kim
  Cc: Andrew Morton, linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki,
	Mel Gorman

On Thu, 2011-02-24 at 08:37 +0900, Minchan Kim wrote:
> On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Sun, 20 Feb 2011 08:41:21 +0900
> > Minchan Kim <minchan.kim@gmail.com> wrote:
> >
> >> Resend.
> >
> > Reignore.
> >
> >> he patch is based on mmotm-2011-02-04 +
> >> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> >>
> >> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> >> > This patch optmizes replace_page_cache_page.
> >> >
> >> > 1) remove radix_tree_preload
> >> > 2) single radix_tree_lookup_slot and replace radix tree slot
> >> > 3) page accounting optimization if both pages are in same zone.
> >> >
> >> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> >> > Cc: Rik van Riel <riel@redhat.com>
> >> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >> > Cc: Mel Gorman <mel@csn.ul.ie>
> >> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> >> > ---
> >> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> >> >  1 files changed, 51 insertions(+), 10 deletions(-)
> >> >
> >> > Hi Miklos,
> >> > This patch is totally not tested.
> >> > Could you test this patch?
> >
> > ^^^ Because of this.
> >
> > Is it tested yet?
> >
> 
> Miklos. Could you test this?
> If you are busy, let me know how to test it. I will.
> Thanks.

Grab git version of libfuse and do something like this:

 fuse/example/fusexmp_fh -obig_writes /mnt/fuse/
 dd if=/tmp/random0 of=/mnt/fuse/tmp/random1 bs=1M
 md5sum /tmp/radom0 /tmp/random1

This should exercise the page moving.

I'll review and test the patch when I have some time.

Thanks,
Miklos

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
  2011-02-24 10:56         ` Miklos Szeredi
@ 2011-03-21 22:06           ` Andrew Morton
  -1 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2011-03-21 22:06 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: Minchan Kim, linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki, Mel Gorman

On Thu, 24 Feb 2011 11:56:55 +0100
Miklos Szeredi <mszeredi@suse.cz> wrote:

> On Thu, 2011-02-24 at 08:37 +0900, Minchan Kim wrote:
> > On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
> > <akpm@linux-foundation.org> wrote:
> > > On Sun, 20 Feb 2011 08:41:21 +0900
> > > Minchan Kim <minchan.kim@gmail.com> wrote:
> > >
> > >> Resend.
> > >
> > > Reignore.
> > >
> > >> he patch is based on mmotm-2011-02-04 +
> > >> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> > >>
> > >> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> > >> > This patch optmizes replace_page_cache_page.
> > >> >
> > >> > 1) remove radix_tree_preload
> > >> > 2) single radix_tree_lookup_slot and replace radix tree slot
> > >> > 3) page accounting optimization if both pages are in same zone.
> > >> >
> > >> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> > >> > Cc: Rik van Riel <riel@redhat.com>
> > >> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > >> > Cc: Mel Gorman <mel@csn.ul.ie>
> > >> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> > >> > ---
> > >> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> > >> >  1 files changed, 51 insertions(+), 10 deletions(-)
> > >> >
> > >> > Hi Miklos,
> > >> > This patch is totally not tested.
> > >> > Could you test this patch?
> > >
> > > ^^^ Because of this.
> > >
> > > Is it tested yet?
> > >
> > 
> > Miklos. Could you test this?
> > If you are busy, let me know how to test it. I will.
> > Thanks.
> 
> Grab git version of libfuse and do something like this:
> 
>  fuse/example/fusexmp_fh -obig_writes /mnt/fuse/
>  dd if=/tmp/random0 of=/mnt/fuse/tmp/random1 bs=1M
>  md5sum /tmp/radom0 /tmp/random1
> 
> This should exercise the page moving.
> 
> I'll review and test the patch when I have some time.
> 

Too late.  It took months to half-finish Miklos's patch and now I'm
sitting on other patches which depend on it, so it's going in.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mm: optimize replace_page_cache_page
@ 2011-03-21 22:06           ` Andrew Morton
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2011-03-21 22:06 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: Minchan Kim, linux-mm, LKML, Rik van Riel, KAMEZAWA Hiroyuki, Mel Gorman

On Thu, 24 Feb 2011 11:56:55 +0100
Miklos Szeredi <mszeredi@suse.cz> wrote:

> On Thu, 2011-02-24 at 08:37 +0900, Minchan Kim wrote:
> > On Thu, Feb 24, 2011 at 7:44 AM, Andrew Morton
> > <akpm@linux-foundation.org> wrote:
> > > On Sun, 20 Feb 2011 08:41:21 +0900
> > > Minchan Kim <minchan.kim@gmail.com> wrote:
> > >
> > >> Resend.
> > >
> > > Reignore.
> > >
> > >> he patch is based on mmotm-2011-02-04 +
> > >> mm-add-replace_page_cache_page-function-add-freepage-hook.patch.
> > >>
> > >> On Fri, Feb 11, 2011 at 01:33:46AM +0900, Minchan Kim wrote:
> > >> > This patch optmizes replace_page_cache_page.
> > >> >
> > >> > 1) remove radix_tree_preload
> > >> > 2) single radix_tree_lookup_slot and replace radix tree slot
> > >> > 3) page accounting optimization if both pages are in same zone.
> > >> >
> > >> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> > >> > Cc: Rik van Riel <riel@redhat.com>
> > >> > Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > >> > Cc: Mel Gorman <mel@csn.ul.ie>
> > >> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> > >> > ---
> > >> >  mm/filemap.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++---------
> > >> >  1 files changed, 51 insertions(+), 10 deletions(-)
> > >> >
> > >> > Hi Miklos,
> > >> > This patch is totally not tested.
> > >> > Could you test this patch?
> > >
> > > ^^^ Because of this.
> > >
> > > Is it tested yet?
> > >
> > 
> > Miklos. Could you test this?
> > If you are busy, let me know how to test it. I will.
> > Thanks.
> 
> Grab git version of libfuse and do something like this:
> 
>  fuse/example/fusexmp_fh -obig_writes /mnt/fuse/
>  dd if=/tmp/random0 of=/mnt/fuse/tmp/random1 bs=1M
>  md5sum /tmp/radom0 /tmp/random1
> 
> This should exercise the page moving.
> 
> I'll review and test the patch when I have some time.
> 

Too late.  It took months to half-finish Miklos's patch and now I'm
sitting on other patches which depend on it, so it's going in.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-03-21 22:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 16:33 [PATCH] mm: optimize replace_page_cache_page Minchan Kim
2011-02-10 16:33 ` Minchan Kim
2011-02-19 23:41 ` Minchan Kim
2011-02-19 23:41   ` Minchan Kim
2011-02-23 22:44   ` Andrew Morton
2011-02-23 22:44     ` Andrew Morton
2011-02-23 23:37     ` Minchan Kim
2011-02-23 23:37       ` Minchan Kim
2011-02-24 10:56       ` Miklos Szeredi
2011-02-24 10:56         ` Miklos Szeredi
2011-03-21 22:06         ` Andrew Morton
2011-03-21 22:06           ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.