linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Add GFP_NOWAIT
@ 2006-04-06 16:55 Jeff Dike
  2006-04-06 22:11 ` Nathan Scott
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Dike @ 2006-04-06 16:55 UTC (permalink / raw)
  To: akpm; +Cc: linux-xfs, Daniel Phillips, linux-kernel, user-mode-linux-devel

Introduce GFP_NOWAIT, as an alias for GFP_ATOMIC & ~__GFP_HIGH.

This also changes XFS, which is the only in-tree user of this idiom that I 
could find.  The XFS piece is compile-tested only.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.16/fs/xfs/linux-2.6/xfs_buf.c
===================================================================
--- linux-2.6.16.orig/fs/xfs/linux-2.6/xfs_buf.c	2006-04-06 12:16:14.000000000 -0400
+++ linux-2.6.16/fs/xfs/linux-2.6/xfs_buf.c	2006-04-06 12:16:54.000000000 -0400
@@ -182,7 +182,7 @@ free_address(
 {
 	a_list_t	*aentry;
 
-	aentry = kmalloc(sizeof(a_list_t), GFP_ATOMIC & ~__GFP_HIGH);
+	aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
 	if (likely(aentry)) {
 		spin_lock(&as_lock);
 		aentry->next = as_free_head;
Index: linux-2.6.16/include/linux/gfp.h
===================================================================
--- linux-2.6.16.orig/include/linux/gfp.h	2006-03-21 11:50:12.000000000 -0500
+++ linux-2.6.16/include/linux/gfp.h	2006-04-06 12:15:18.000000000 -0400
@@ -57,6 +57,8 @@ struct vm_area_struct;
 			__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
 			__GFP_NOMEMALLOC|__GFP_HARDWALL)
 
+/* This equals 0, but use constants in case they ever change */
+#define GFP_NOWAIT	(GFP_ATOMIC & ~__GFP_HIGH)
 /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
 #define GFP_ATOMIC	(__GFP_HIGH)
 #define GFP_NOIO	(__GFP_WAIT)


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

* Re: [PATCH 1/2] Add GFP_NOWAIT
  2006-04-06 16:55 [PATCH 1/2] Add GFP_NOWAIT Jeff Dike
@ 2006-04-06 22:11 ` Nathan Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Scott @ 2006-04-06 22:11 UTC (permalink / raw)
  To: Jeff Dike
  Cc: akpm, linux-xfs, Daniel Phillips, linux-kernel, user-mode-linux-devel

On Thu, Apr 06, 2006 at 12:55:22PM -0400, Jeff Dike wrote:
> Introduce GFP_NOWAIT, as an alias for GFP_ATOMIC & ~__GFP_HIGH.
> 
> This also changes XFS, which is the only in-tree user of this idiom that I 
> could find.  The XFS piece is compile-tested only.

Looks fine, thanks Jeff.

> Signed-off-by: Jeff Dike <jdike@addtoit.com>
Acked-by: Nathan Scott <nathans@sgi.com>

cheers.

-- 
Nathan

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

end of thread, other threads:[~2006-04-06 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06 16:55 [PATCH 1/2] Add GFP_NOWAIT Jeff Dike
2006-04-06 22:11 ` Nathan Scott

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).