linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations
@ 2001-06-14 12:59 Marcelo Tosatti
  2001-06-14 17:17 ` Daniel Phillips
  0 siblings, 1 reply; 4+ messages in thread
From: Marcelo Tosatti @ 2001-06-14 12:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Rik van Riel, linux-mm, lkml

  
Message-ID: <Pine.LNX.4.21.0106140949550.8439-100000@freak.distro.conectiva>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Linus, 

In pre3, GFP_BUFFER allocations can eat from the "emergency" memory
reservations in case try_to_free_pages() fails for those allocations in
__alloc_pages(). 


Here goes the (tested) patch to fix that: 


--- linux/mm/page_alloc.c.orig	Thu Jun 14 11:00:14 2001
+++ linux/mm/page_alloc.c	Thu Jun 14 11:32:56 2001
@@ -453,6 +453,12 @@
 				int progress = try_to_free_pages(gfp_mask);
 				if (progress || gfp_mask & __GFP_IO)
 					goto try_again;
+				/*
+				 * Fail in case no progress was made and the
+				 * allocation may not be able to block on IO.
+				 */
+				else
+					return NULL;
 			}
 		}
 	}


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

* Re: [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations
  2001-06-14 12:59 [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations Marcelo Tosatti
@ 2001-06-14 17:17 ` Daniel Phillips
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Phillips @ 2001-06-14 17:17 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-mm, lkml

On Thursday 14 June 2001 14:59, Marcelo Tosatti wrote:
> --- linux/mm/page_alloc.c.orig	Thu Jun 14 11:00:14 2001
> +++ linux/mm/page_alloc.c	Thu Jun 14 11:32:56 2001
> @@ -453,6 +453,12 @@
>  				int progress = try_to_free_pages(gfp_mask);
>  				if (progress || gfp_mask & __GFP_IO)
>  					goto try_again;
> +				/*
> +				 * Fail in case no progress was made and the
> +				 * allocation may not be able to block on IO.
> +				 */
> +				else
> +					return NULL;
>  			}
>  		}
>  	}

Nitpick dept: the 'else' is redundant.

--
Daniel

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

* [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations
@ 2001-06-21  2:13 Marcelo Tosatti
  0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2001-06-21  2:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml, linux-mm


Linus,

I just read pre3<->pre4 diff and it seems you missed this patch... here it
goes again.

In pre3/4, GFP_BUFFER allocations can eat from the "emergency" memory
reservations in case try_to_free_pages() fails for those allocations in
__alloc_pages().


Here goes the (tested) patch to fix that:


--- linux/mm/page_alloc.c.orig	Thu Jun 14 11:00:14 2001
+++ linux/mm/page_alloc.c	Thu Jun 14 11:32:56 2001
@@ -453,6 +453,12 @@
 				int progress = try_to_free_pages(gfp_mask);
 				if (progress || gfp_mask & __GFP_IO)
 					goto try_again;
+				/*
+				 * Fail in case no progress was made and the
+				 * allocation may not be able to block on IO.
+				 */
+				else
+					return NULL;
 			}
 		}
 	}



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

* Re: [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations
       [not found] <20010614142822Z131175-12594+95@kanga.kvack.org>
@ 2001-06-15 15:07 ` Chris Mason
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Mason @ 2001-06-15 15:07 UTC (permalink / raw)
  To: Marcelo Tosatti, Linus Torvalds; +Cc: Rik van Riel, linux-mm, lkml



On Thursday, June 14, 2001 09:59:43 AM -0300 Marcelo Tosatti
<marcelo@conectiva.com.br> wrote:

> 
> In pre3, GFP_BUFFER allocations can eat from the "emergency" memory
> reservations in case try_to_free_pages() fails for those allocations in
> __alloc_pages(). 
> 
> 
> Here goes the (tested) patch to fix that: 

I started testing this because I expected problems under load with reiserfs
on it.  No deadlocks yet though...I owe Marcelo a beer ;-)

-chris


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

end of thread, other threads:[~2001-06-21  4:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-14 12:59 [PATCH] Avoid !__GFP_IO allocations to eat from memory reservations Marcelo Tosatti
2001-06-14 17:17 ` Daniel Phillips
     [not found] <20010614142822Z131175-12594+95@kanga.kvack.org>
2001-06-15 15:07 ` Chris Mason
2001-06-21  2:13 Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).