[Galaxy 3 Android Development] cdesai:
Difference in mm folder

diff -crB linux/mm g3/mm > mm.patch

Only in g3/mm: ashmem.c
diff -crB linux/mm/Makefile g3/mm/Makefile
*** linux/mm/Makefile	2010-02-23 07:38:51.000000000 -0800
--- g3/mm/Makefile	2011-02-26 04:41:59.000000000 -0800
***************
*** 22,27 ****
--- 22,28 ----
obj-$(CONFIG_NUMA)	+= mempolicy.o
obj-$(CONFIG_SPARSEMEM)	+= sparse.o
obj-$(CONFIG_SPARSEMEM_VMEMMAP) += sparse-vmemmap.o
+ obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_TMPFS_POSIX_ACL) += shmem_acl.o
obj-$(CONFIG_SLOB) += slob.o
obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o
diff -crB linux/mm/page_alloc.c g3/mm/page_alloc.c
*** linux/mm/page_alloc.c	2010-02-23 07:38:51.000000000 -0800
--- g3/mm/page_alloc.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 122,127 ****
--- 122,128 ----
};

int min_free_kbytes = 1024;
+ int min_free_order_shift = 1;

static unsigned long __meminitdata nr_kernel_pages;
static unsigned long __meminitdata nr_all_pages;
***************
*** 1380,1386 ****
free_pages -= z->free_area[o].nr_free << o;

/* Require fewer higher order pages to be free */
!	min >>= 1;

if (free_pages <= min)
return 0;
--- 1381,1387 ----
free_pages -= z->free_area[o].nr_free << o;

/* Require fewer higher order pages to be free */
!	min >>= min_free_order_shift;

if (free_pages <= min)
return 0;
***************
*** 2859,2864 ****
--- 2860,2879 ----
#define LONG_ALIGN(x) (((x)+(sizeof(long))-1)&~((sizeof(long))-1))

/*
+ * Check if a pageblock contains reserved pages
+ */
+ static int pageblock_is_reserved(unsigned long start_pfn)
+ {
+	unsigned long end_pfn = start_pfn + pageblock_nr_pages;
+	unsigned long pfn;
+
+	for (pfn = start_pfn; pfn < end_pfn; pfn++)
+	if (PageReserved(pfn_to_page(pfn)))
+	return 1;
+	return 0;
+ }
+
+ /*
* Mark a number of pageblocks as MIGRATE_RESERVE. The number
* of blocks reserved is based on min_wmark_pages(zone). The memory within
* the reserve will tend to store contiguous free pages. Setting min_free_kbytes
***************
*** 2897,2903 ****
continue;

/* Blocks with reserved pages will never free, skip them. */
!	if (PageReserved(page))
continue;

block_migratetype = get_pageblock_migratetype(page);
--- 2912,2918 ----
continue;

/* Blocks with reserved pages will never free, skip them. */
!	if (pageblock_is_reserved(pfn))
continue;

block_migratetype = get_pageblock_migratetype(page);
diff -crB linux/mm/shmem.c g3/mm/shmem.c
*** linux/mm/shmem.c	2010-02-23 07:38:51.000000000 -0800
--- g3/mm/shmem.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 2674,2679 ****
--- 2674,2687 ----
}
EXPORT_SYMBOL_GPL(shmem_file_setup);

+ void shmem_set_file(struct vm_area_struct *vma, struct file *file)
+ {
+	if (vma->vm_file)
+	fput(vma->vm_file);
+	vma->vm_file = file;
+	vma->vm_ops = &shmem_vm_ops;
+ }
+
/**
* shmem_zero_setup - setup a shared anonymous mapping
* @vma: the vma to be mmapped is prepared by do_mmap_pgoff
***************
*** 2686,2695 ****
file = shmem_file_setup("dev/zero", size, vma->vm_flags);
if (IS_ERR(file))
return PTR_ERR(file);
!
!	if (vma->vm_file)
!	fput(vma->vm_file);
!	vma->vm_file = file;
!	vma->vm_ops = &shmem_vm_ops;
return 0;
}
--- 2694,2699 ----
file = shmem_file_setup("dev/zero", size, vma->vm_flags);
if (IS_ERR(file))
return PTR_ERR(file);
!	shmem_set_file(vma, file);
return 0;
}