Skip to contentSkip to conversation

topdown support for ppc64

PATCH New Andy Whitcroft 1 participant 1 message Sep 1, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 topdown support for ppc64

Recent patches introduced a top down user process address space allocation policy; further patches enable this for ppc64. Although these work correctly for normal maps, the topdown algorithm does not take into account stringent mixing constraints for small and large pages on this architecture. These patches introduce a ppc64 specific arch_get_unused_area_topdown() variant. The first introduces infrastructure to allow replacement of the generic arch_get_unused_area_topdown() and the second utilises this infrastructure.

In this patch I have followed the pattern set by the arch_get_unused_area() using HAVE_ARCH_UNMAPPED_AREA_TOPDOWN to be consistent. However, it would also be possible to simply have a ppc64_get_unused_area_topdown() in the arch/ppc64/mm/mmap.c or to use weak bindings.

-apw

=== 8< ===
Allow an architecture to override the default definition of arch_get_unmapped_area_topdown().

Revision: $Rev: 602 $

diffstat 090-arch_topdown

---
 mmap.c |    2 ++
 1 files changed, 2 insertions(+)
mm/mmap.c +2 -0
diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/mm/mmap.c current/mm/mmap.c
@@ -1078,6 +1078,7 @@ void arch_unmap_area(struct vm_area_stru
  * This mmap-allocator allocates new areas top-down from below the
  * stack's low limit (the base):
  */
+#ifndef HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 unsigned long
 arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
 			  const unsigned long len, const unsigned long pgoff,
@@ -1162,6 +1163,7 @@ fail:
 
 	return addr;
 }
+#endif
 
 void arch_unmap_area_topdown(struct vm_area_struct *area)
 {