Thread (9 messages) 9 messages, 6 authors, 2012-06-14

Re: [PATCH] mm: add gfp_mask parameter to vm_map_ram()

From: Dave Chinner <david@fromorbit.com>
Date: 2012-06-14 02:15:47
Also in: linux-fsdevel, linux-xfs, lkml

On Thu, Jun 14, 2012 at 09:49:02AM +0800, Fengguang Wu wrote:
quoted hunk ↗ jump to hunk
On Thu, Jun 14, 2012 at 11:20:26AM +1000, Dave Chinner wrote:
quoted
Bug in vm_map_ram - it does an unconditional GFP_KERNEL allocation
here, and we are in a GFP_NOFS context. We can't pass a gfp_mask to
vm_map_ram(), so until vm_map_ram() grows that we can't fix it...
This trivial patch should fix it.

The only behavior change is the XFS part:
@@ -406,7 +406,7 @@ _xfs_buf_map_pages(
 
                do {
                        bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
-                                               -1, PAGE_KERNEL);
+                                               -1, GFP_NOFS, PAGE_KERNEL);
This function isn't always called in GFP_NOFS context - readahead
uses different memory allocation semantics (no retry, no warn), so
there are flags that tell it what to do. i.e.

-						-1, PAGE_KERNEL);
+						-1, xb_to_gfp(flags), PAGE_KERNEL);

Otherwise looks fine to me...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help