linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
@ 2005-12-20  8:53 Yasunori Goto
  2006-01-03 21:34 ` Joel Schopp
  0 siblings, 1 reply; 7+ messages in thread
From: Yasunori Goto @ 2005-12-20  8:53 UTC (permalink / raw)
  To: Linux Kernel ML, linux-mm, Linux Hotplug Memory Support; +Cc: Joel Schopp

This patch is to disable __GFP_EASY_RECLAIM at some part.
The parts are followings.

  1) add_to_page_cache()
  2) pipe_writev()
  3) shmem_dir_alloc()
  4) page_symlink()


1) If this patch is not applied, cache_grow() checks and call BUG(),
   at here. 

	if (flags & ~(SLAB_DMA|SLAB_LEVEL_MASK|SLAB_NO_GROW))
		BUG();

  This patch is to solve it.

2) This page is allocated by alloc_pages(GFP_HIGHUSER) directly, and 
   it is kmapped when it is accessed as inode.
   But, it is not reclaimed by anyone.

3) This page is used for directory for shmem. So, it is very hard
   to reclaim.

4) Same with 2).


take3 -> take 4:
  Add disable part to pipe, shmem, and symlink.

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>

Index: zone_reclaim/mm/filemap.c
===================================================================
--- zone_reclaim.orig/mm/filemap.c	2005-12-16 18:36:20.000000000 +0900
+++ zone_reclaim/mm/filemap.c	2005-12-16 19:15:35.000000000 +0900
@@ -395,7 +395,7 @@ int filemap_write_and_wait_range(struct 
 int add_to_page_cache(struct page *page, struct address_space *mapping,
 		pgoff_t offset, gfp_t gfp_mask)
 {
-	int error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
+	int error = radix_tree_preload(gfp_mask & ~(__GFP_HIGHMEM | __GFP_EASY_RECLAIM));
 
 	if (error == 0) {
 		write_lock_irq(&mapping->tree_lock);
Index: zone_reclaim/fs/pipe.c
===================================================================
--- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
+++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
@@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
 			int error;
 
 			if (!page) {
-				page = alloc_page(GFP_HIGHUSER);
+				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
 				if (unlikely(!page)) {
 					ret = ret ? : -ENOMEM;
 					break;
Index: zone_reclaim/mm/shmem.c
===================================================================
--- zone_reclaim.orig/mm/shmem.c	2005-12-16 18:36:20.000000000 +0900
+++ zone_reclaim/mm/shmem.c	2005-12-16 19:15:35.000000000 +0900
@@ -89,6 +89,7 @@ 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_mask &= ~__GFP_EASY_RECLAIM;
 	return alloc_pages(gfp_mask, PAGE_CACHE_SHIFT-PAGE_SHIFT);
 }
 
Index: zone_reclaim/fs/namei.c
===================================================================
--- zone_reclaim.orig/fs/namei.c	2005-12-16 18:36:20.000000000 +0900
+++ zone_reclaim/fs/namei.c	2005-12-16 19:30:49.000000000 +0900
@@ -2502,10 +2502,12 @@ void page_put_link(struct dentry *dentry
 int page_symlink(struct inode *inode, const char *symname, int len)
 {
 	struct address_space *mapping = inode->i_mapping;
-	struct page *page = grab_cache_page(mapping, 0);
+	struct page *page;
 	int err = -ENOMEM;
 	char *kaddr;
 
+	mapping_set_gfp_mask(mapping, mapping_gfp_mask(mapping) & ~__GFP_EASY_RECLAIM);
+	page = grab_cache_page(mapping, 0);
 	if (!page)
 		goto fail;
 	err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);

-- 
Yasunori Goto 


--
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] 7+ messages in thread

* Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2005-12-20  8:53 [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8] Yasunori Goto
@ 2006-01-03 21:34 ` Joel Schopp
  2006-01-05  5:43   ` Yasunori Goto
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Schopp @ 2006-01-03 21:34 UTC (permalink / raw)
  To: Yasunori Goto; +Cc: Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

> ===================================================================
> --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
>  			int error;
>  
>  			if (!page) {
> -				page = alloc_page(GFP_HIGHUSER);
> +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
>  				if (unlikely(!page)) {
>  					ret = ret ? : -ENOMEM;
>  					break;

That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
somesuch define back in patch 1, then use it 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] 7+ messages in thread

* Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2006-01-03 21:34 ` Joel Schopp
@ 2006-01-05  5:43   ` Yasunori Goto
  2006-01-05  9:47     ` Mel Gorman
  0 siblings, 1 reply; 7+ messages in thread
From: Yasunori Goto @ 2006-01-05  5:43 UTC (permalink / raw)
  To: jschopp; +Cc: Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

> 
> > ===================================================================
> > --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> > +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> > @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
> >  			int error;
> >  
> >  			if (!page) {
> > -				page = alloc_page(GFP_HIGHUSER);
> > +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
> >  				if (unlikely(!page)) {
> >  					ret = ret ? : -ENOMEM;
> >  					break;
> 
> That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
> somesuch define back in patch 1, then use it here?

It looks better. Thanks for your idea.

-- 
Yasunori Goto 


--
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] 7+ messages in thread

* Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2006-01-05  5:43   ` Yasunori Goto
@ 2006-01-05  9:47     ` Mel Gorman
  2006-01-05 10:59       ` Yasunori Goto
  0 siblings, 1 reply; 7+ messages in thread
From: Mel Gorman @ 2006-01-05  9:47 UTC (permalink / raw)
  To: Yasunori Goto
  Cc: jschopp, Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

On (05/01/06 14:43), Yasunori Goto didst pronounce:
> > 
> > > ===================================================================
> > > --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> > > +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> > > @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
> > >  			int error;
> > >  
> > >  			if (!page) {
> > > -				page = alloc_page(GFP_HIGHUSER);
> > > +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
> > >  				if (unlikely(!page)) {
> > >  					ret = ret ? : -ENOMEM;
> > >  					break;
> > 
> > That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
> > somesuch define back in patch 1, then use it here?
> 
> It looks better. Thanks for your idea.
> 

There are other places where GFP_HIGHUSER is used for pages that are not easily
reclaimed. It is easier clearer to add __GFP_EASY_RECLAIM at the places you
know pages are easily reclaimed rather than removing __GFP_EASY_RECLAIM from
awkward places.

-- 
Mel Gorman
Part-time Phd Student
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] 7+ messages in thread

* Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2006-01-05  9:47     ` Mel Gorman
@ 2006-01-05 10:59       ` Yasunori Goto
  2006-01-05 11:23         ` Mel Gorman
  0 siblings, 1 reply; 7+ messages in thread
From: Yasunori Goto @ 2006-01-05 10:59 UTC (permalink / raw)
  To: Mel Gorman
  Cc: jschopp, Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

> On (05/01/06 14:43), Yasunori Goto didst pronounce:
> > > 
> > > > ===================================================================
> > > > --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> > > > +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> > > > @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
> > > >  			int error;
> > > >  
> > > >  			if (!page) {
> > > > -				page = alloc_page(GFP_HIGHUSER);
> > > > +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
> > > >  				if (unlikely(!page)) {
> > > >  					ret = ret ? : -ENOMEM;
> > > >  					break;
> > > 
> > > That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
> > > somesuch define back in patch 1, then use it here?
> > 
> > It looks better. Thanks for your idea.
> > 
> 
> There are other places where GFP_HIGHUSER is used for pages that are not easily
> reclaimed. It is easier clearer to add __GFP_EASY_RECLAIM at the places you
> know pages are easily reclaimed rather than removing __GFP_EASY_RECLAIM from
> awkward places.

I thought that other pages can be migrated by Chlistoph-san's (and
Kame-san's) patch. May I ask which page should be no EASY_RECLAIM?
Am I overlooking anything?


Thanks.

-- 
Yasunori Goto 


--
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] 7+ messages in thread

* Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2006-01-05 10:59       ` Yasunori Goto
@ 2006-01-05 11:23         ` Mel Gorman
  2006-01-06  1:36           ` [Lhms-devel] " Yasunori Goto
  0 siblings, 1 reply; 7+ messages in thread
From: Mel Gorman @ 2006-01-05 11:23 UTC (permalink / raw)
  To: Yasunori Goto
  Cc: jschopp, Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

On (05/01/06 19:59), Yasunori Goto didst pronounce:
> > On (05/01/06 14:43), Yasunori Goto didst pronounce:
> > > > 
> > > > > ===================================================================
> > > > > --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> > > > > +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> > > > > @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
> > > > >  			int error;
> > > > >  
> > > > >  			if (!page) {
> > > > > -				page = alloc_page(GFP_HIGHUSER);
> > > > > +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
> > > > >  				if (unlikely(!page)) {
> > > > >  					ret = ret ? : -ENOMEM;
> > > > >  					break;
> > > > 
> > > > That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
> > > > somesuch define back in patch 1, then use it here?
> > > 
> > > It looks better. Thanks for your idea.
> > > 
> > 
> > There are other places where GFP_HIGHUSER is used for pages that are not easily
> > reclaimed. It is easier clearer to add __GFP_EASY_RECLAIM at the places you
> > know pages are easily reclaimed rather than removing __GFP_EASY_RECLAIM from
> > awkward places.
> 
> I thought that other pages can be migrated by Chlistoph-san's (and
> Kame-san's) patch.

Then the pages are not "easily reclaimed", they can just be moved by
some other mechanism.

> May I ask which page should be no EASY_RECLAIM?

Based on http://lxr.linux.no/ident?i=GFP_HIGHUSER, examples include HugeTLB
pages, pages allocated by the infiniband driver, pages allocated by the NFS
driver and inode pages.

-- 
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] 7+ messages in thread

* Re: [Lhms-devel] Re: [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8]
  2006-01-05 11:23         ` Mel Gorman
@ 2006-01-06  1:36           ` Yasunori Goto
  0 siblings, 0 replies; 7+ messages in thread
From: Yasunori Goto @ 2006-01-06  1:36 UTC (permalink / raw)
  To: Mel Gorman
  Cc: jschopp, Linux Kernel ML, linux-mm, Linux Hotplug Memory Support

> On (05/01/06 19:59), Yasunori Goto didst pronounce:
> > > On (05/01/06 14:43), Yasunori Goto didst pronounce:
> > > > > 
> > > > > > ===================================================================
> > > > > > --- zone_reclaim.orig/fs/pipe.c	2005-12-16 18:36:20.000000000 +0900
> > > > > > +++ zone_reclaim/fs/pipe.c	2005-12-16 19:15:35.000000000 +0900
> > > > > > @@ -284,7 +284,7 @@ pipe_writev(struct file *filp, const str
> > > > > >  			int error;
> > > > > >  
> > > > > >  			if (!page) {
> > > > > > -				page = alloc_page(GFP_HIGHUSER);
> > > > > > +				page = alloc_page(GFP_HIGHUSER & ~__GFP_EASY_RECLAIM);
> > > > > >  				if (unlikely(!page)) {
> > > > > >  					ret = ret ? : -ENOMEM;
> > > > > >  					break;
> > > > > 
> > > > > That is a bit hard to understand.  How about a new GFP_HIGHUSER_HARD or 
> > > > > somesuch define back in patch 1, then use it here?
> > > > 
> > > > It looks better. Thanks for your idea.
> > > > 
> > > 
> > > There are other places where GFP_HIGHUSER is used for pages that are not easily
> > > reclaimed. It is easier clearer to add __GFP_EASY_RECLAIM at the places you
> > > know pages are easily reclaimed rather than removing __GFP_EASY_RECLAIM from
> > > awkward places.
> > 
> > I thought that other pages can be migrated by Chlistoph-san's (and
> > Kame-san's) patch.
> 
> Then the pages are not "easily reclaimed", they can just be moved by
> some other mechanism.

Ah. My naming was no good. :-(


> > May I ask which page should be no EASY_RECLAIM?
> 
> Based on http://lxr.linux.no/ident?i=GFP_HIGHUSER, examples include HugeTLB
> pages, pages allocated by the infiniband driver, pages allocated by the NFS
> driver and inode pages.

Hmmmm.
Ok. Your proposal looks better.

Thanks.

-- 
Yasunori Goto 


--
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] 7+ messages in thread

end of thread, other threads:[~2006-01-06  1:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-20  8:53 [Patch] New zone ZONE_EASY_RECLAIM take 4. (disable gfp_easy_reclaim bit)[5/8] Yasunori Goto
2006-01-03 21:34 ` Joel Schopp
2006-01-05  5:43   ` Yasunori Goto
2006-01-05  9:47     ` Mel Gorman
2006-01-05 10:59       ` Yasunori Goto
2006-01-05 11:23         ` Mel Gorman
2006-01-06  1:36           ` [Lhms-devel] " Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox