Skip to contentSkip to conversation

patch to remove warning in 2.6.11 + Hirokazu's page migration patches

PATCH Ray Bryant 2 participants 2 messages Mar 25, 2005

Subsystems (2)
lore
Share & tools
lore

Ray Bryant

author
#0 lore raw

Hirokazu,

The attached patch fixes a minor problem with your 2.6.11 page migration patches.

Signature · 9 lines
Best Regards,
Ray
-----------------------------------------------
                  Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)
[email protected]             [email protected]
The box said: "Requires Windows 98 or better",
           so I installed Linux.
-----------------------------------------------

This patch fixes a warning in the compilation of mm/memory.c when Hirokazu's 2.6.11 memory-migration patches are applied. The warning is due to the fact that clear_user_pages() below needs to pass a void * in as its first argument, since, (at least on ia64), clear_user_pages() is a macro that calls clear_page(first arg to clear_user_pages()), and clear_page() wants a void * argument.

The change below was suggested by Christoph Lameter and both avoids this problem and makes the code simpler.

mm/memory.c +3 -5
Index: linux-2.6.11-page-migration/mm/memory.c
===================================================================
@@ -1323,11 +1323,9 @@ static int do_wp_page(struct mm_struct *
 		goto no_new_page;
 
 	if (old_page == ZERO_PAGE(address)) {
-		if (VM_Immovable(vma)) {
-			new_page = alloc_page_vma(GFP_USER, vma, address);
-			if (new_page)
-				clear_user_page(address, address, new_page);
-		} else
+		if (VM_Immovable(vma))
+			new_page = alloc_page_vma(GFP_USER | __GFP_ZERO, vma, address);
+		else
 			new_page = alloc_zeroed_user_highpage(vma, address);
 		if (!new_page)
 			goto no_new_page;