rpms/kernel/F-11 linux-2.6-defaults-saner-vm-settings.patch, NONE, 1.1 linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch, NONE, 1.1 kernel.spec, 1.1652, 1.1653 linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch, 1.1, 1.2 linux-2.6-mm-lru-evict-streaming-io-pages-first.patch, 1.1, 1.2

Chuck Ebbert cebbert at fedoraproject.org
Wed Jun 17 00:11:00 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv318

Modified Files:
	kernel.spec 
	linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch 
	linux-2.6-mm-lru-evict-streaming-io-pages-first.patch 
Added Files:
	linux-2.6-defaults-saner-vm-settings.patch 
	linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch 
Log Message:
Copy latest version of the -mm streaming IO and executable pages patches from F-10
Copy the saner-vm-settings patch from F-10:
    change writeback interval from 5,30 seconds to 3,10 seconds
Comment out the null credentials debugging patch (bug #494067)

linux-2.6-defaults-saner-vm-settings.patch:

--- NEW FILE linux-2.6-defaults-saner-vm-settings.patch ---
Raise default dirty data limits, per:
http://marc.info/?l=linux-kernel&m=123707714231039&w=2

Also lower default swappiness from 60 to 40.

--- work-2.6.29.4.orig/mm/page-writeback.c
+++ work-2.6.29.4/mm/page-writeback.c
@@ -66,7 +66,7 @@ static inline long sync_writeback_pages(
 /*
  * Start background writeback (via pdflush) at this percentage
  */
-int dirty_background_ratio = 5;
+int dirty_background_ratio = 7;
 
 /*
  * dirty_background_bytes starts at 0 (disabled) so that it is a function of
@@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
 /*
  * The generator of dirty data starts writeback at this percentage
  */
-int vm_dirty_ratio = 10;
+int vm_dirty_ratio = 15;
 
 /*
  * vm_dirty_bytes starts at 0 (disabled) so that it is a function of
@@ -94,12 +94,12 @@ unsigned long vm_dirty_bytes;
 /*
  * The interval between `kupdate'-style writebacks, in jiffies
  */
-int dirty_writeback_interval = 5 * HZ;
+int dirty_writeback_interval = 3 * HZ;
 
 /*
  * The longest number of jiffies for which data is allowed to remain dirty
  */
-int dirty_expire_interval = 30 * HZ;
+int dirty_expire_interval = 10 * HZ;
 
 /*
  * Flag that makes the machine dump writes/reads and block dirtyings.
--- work-2.6.29.4.orig/mm/vmscan.c
+++ work-2.6.29.4/mm/vmscan.c
@@ -118,7 +118,7 @@ struct scan_control {
 /*
  * From 0 .. 100.  Higher means more swappy.
  */
-int vm_swappiness = 60;
+int vm_swappiness = 40;
 long vm_total_pages;	/* The total number of pages which the VM controls */
 
 static LIST_HEAD(shrinker_list);

linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch:

--- NEW FILE linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch ---
vmscan: report vm_flags in page_referenced()

This enables more informed reclaim heuristics, eg. to protect executable
file pages more aggressively.

Signed-off-by: Wu Fengguang <fengguang.wu at intel.com>
---

--- linux.orig/include/linux/rmap.h
+++ linux/include/linux/rmap.h
@@ -83,7 +83,8 @@  static inline void page_dup_rmap(struct 
 /*
  * Called from mm/vmscan.c to handle paging out
  */
-int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt);
+int page_referenced(struct page *, int is_locked,
+			struct mem_cgroup *cnt, unsigned long *vm_flags);
 int try_to_unmap(struct page *, int ignore_refs);
 
 /*
@@ -128,7 +129,7 @@  int page_wrprotect(struct page *page, in
 #define anon_vma_prepare(vma)	(0)
 #define anon_vma_link(vma)	do {} while (0)
 
-#define page_referenced(page,l,cnt) TestClearPageReferenced(page)
+#define page_referenced(page, locked, cnt, flags) TestClearPageReferenced(page)
 #define try_to_unmap(page, refs) SWAP_FAIL
 
 static inline int page_mkclean(struct page *page)
--- linux.orig/mm/rmap.c
+++ linux/mm/rmap.c
@@ -333,7 +333,8 @@  static int page_mapped_in_vma(struct pag
  * repeatedly from either page_referenced_anon or page_referenced_file.
  */
 static int page_referenced_one(struct page *page,
-	struct vm_area_struct *vma, unsigned int *mapcount)
+			       struct vm_area_struct *vma,
+			       unsigned int *mapcount)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long address;
@@ -385,7 +386,8 @@  out:
 }
 
 static int page_referenced_anon(struct page *page,
-				struct mem_cgroup *mem_cont)
+				struct mem_cgroup *mem_cont,
+				unsigned long *vm_flags)
 {
 	unsigned int mapcount;
 	struct anon_vma *anon_vma;
@@ -406,6 +408,7 @@  static int page_referenced_anon(struct p
 		if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
 			continue;
 		referenced += page_referenced_one(page, vma, &mapcount);
+		*vm_flags |= vma->vm_flags;
 		if (!mapcount)
 			break;
 	}
@@ -418,6 +421,7 @@  static int page_referenced_anon(struct p
  * page_referenced_file - referenced check for object-based rmap
  * @page: the page we're checking references on.
  * @mem_cont: target memory controller
+ * @vm_flags: collect the encountered vma->vm_flags
  *
  * For an object-based mapped page, find all the places it is mapped and
  * check/clear the referenced flag.  This is done by following the page->mapping
@@ -427,7 +431,8 @@  static int page_referenced_anon(struct p
  * This function is only called from page_referenced for object-based pages.
  */
 static int page_referenced_file(struct page *page,
-				struct mem_cgroup *mem_cont)
+				struct mem_cgroup *mem_cont,
+				unsigned long *vm_flags)
 {
 	unsigned int mapcount;
 	struct address_space *mapping = page->mapping;
@@ -468,6 +473,7 @@  static int page_referenced_file(struct p
 		if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
 			continue;
 		referenced += page_referenced_one(page, vma, &mapcount);
+		*vm_flags |= vma->vm_flags;
 		if (!mapcount)
 			break;
 	}
@@ -481,29 +487,35 @@  static int page_referenced_file(struct p
  * @page: the page to test
  * @is_locked: caller holds lock on the page
  * @mem_cont: target memory controller
+ * @vm_flags: collect the encountered vma->vm_flags
  *
  * Quick test_and_clear_referenced for all mappings to a page,
  * returns the number of ptes which referenced the page.
  */
-int page_referenced(struct page *page, int is_locked,
-			struct mem_cgroup *mem_cont)
+int page_referenced(struct page *page,
+		    int is_locked,
+		    struct mem_cgroup *mem_cont,
+		    unsigned long *vm_flags)
 {
 	int referenced = 0;
 
 	if (TestClearPageReferenced(page))
 		referenced++;
 
+	*vm_flags = 0;
 	if (page_mapped(page) && page->mapping) {
 		if (PageAnon(page))
-			referenced += page_referenced_anon(page, mem_cont);
+			referenced += page_referenced_anon(page, mem_cont,
+								vm_flags);
 		else if (is_locked)
-			referenced += page_referenced_file(page, mem_cont);
+			referenced += page_referenced_file(page, mem_cont,
+								vm_flags);
 		else if (!trylock_page(page))
 			referenced++;
 		else {
 			if (page->mapping)
-				referenced +=
-					page_referenced_file(page, mem_cont);
+				referenced += page_referenced_file(page,
+							mem_cont, vm_flags);
 			unlock_page(page);
 		}
 	}
--- linux.orig/mm/vmscan.c
+++ linux/mm/vmscan.c
@@ -598,6 +598,7 @@  static unsigned long shrink_page_list(st
 	struct pagevec freed_pvec;
 	int pgactivate = 0;
 	unsigned long nr_reclaimed = 0;
+	unsigned long vm_flags;
 
 	cond_resched();
 
@@ -648,7 +649,8 @@  static unsigned long shrink_page_list(st
 				goto keep_locked;
 		}
 
-		referenced = page_referenced(page, 1, sc->mem_cgroup);
+		referenced = page_referenced(page, 1,
+						sc->mem_cgroup, &vm_flags);
 		/* In active use or really unfreeable?  Activate it. */
 		if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&
 					referenced && page_mapping_inuse(page))
@@ -1229,6 +1231,7 @@  static void shrink_active_list(unsigned 
 	unsigned long pgmoved;
 	int pgdeactivate = 0;
 	unsigned long pgscanned;
+	unsigned long vm_flags;
 	LIST_HEAD(l_hold);	/* The pages which were snipped off */
 	LIST_HEAD(l_inactive);
 	struct page *page;
@@ -1269,7 +1272,7 @@  static void shrink_active_list(unsigned 
 
 		/* page_referenced clears PageReferenced */
 		if (page_mapping_inuse(page) &&
-		    page_referenced(page, 0, sc->mem_cgroup))
+		    page_referenced(page, 0, sc->mem_cgroup, &vm_flags))
 			pgmoved++;
 
 		list_add(&page->lru, &l_inactive);



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1652
retrieving revision 1.1653
diff -u -p -r1.1652 -r1.1653
--- kernel.spec	16 Jun 2009 19:37:34 -0000	1.1652
+++ kernel.spec	17 Jun 2009 00:10:28 -0000	1.1653
@@ -596,8 +596,10 @@ Patch22: linux-2.6-utrace.patch
 Patch23: linux-2.6-utrace-ftrace.patch
 
 # vm patches
+Patch24: linux-2.6-defaults-saner-vm-settings.patch
 Patch25: linux-2.6-mm-lru-evict-streaming-io-pages-first.patch
-Patch26: linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch
+Patch26: linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch
+Patch27: linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch
 
 # Support suspend/resume, other crash fixes
 Patch30: linux-2.6-iommu-fixes.patch
@@ -1188,7 +1190,9 @@ ApplyPatch linux-2.6-utrace.patch
 ApplyPatch linux-2.6-utrace-ftrace.patch
 
 # vm patches
+ApplyPatch linux-2.6-defaults-saner-vm-settings.patch
 ApplyPatch linux-2.6-mm-lru-evict-streaming-io-pages-first.patch
+ApplyPatch linux-2.6-mm-lru-report-vm-flags-in-page-referenced.patch
 ApplyPatch linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch
 
 # IOMMU fixes backported to 2.6.29
@@ -1263,7 +1267,7 @@ ApplyPatch linux-2.6-debug-taint-vm.patc
 ApplyPatch linux-2.6-debug-spinlock-taint.patch
 ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
 ApplyPatch linux-2.6-debug-always-inline-kzalloc.patch
-ApplyPatch linux-2.6-debug-selinux-null-creds.patch
+#ApplyPatch linux-2.6-debug-selinux-null-creds.patch
 
 #
 # PCI
@@ -2064,6 +2068,12 @@ fi
 # and build.
 
 %changelog
+* Tue Jun 16 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.5-191
+- Copy latest version of the -mm streaming IO and executable pages patches from F-10
+- Copy the saner-vm-settings patch from F-10:
+    change writeback interval from 5,30 seconds to 3,10 seconds
+- Comment out the null credentials debugging patch (bug #494067)
+
 * Tue Jun 16 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.5-190
 - Two r8169 driver updates from 2.6.30
 - Update via-sdmmc driver

linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch:

Index: linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch	8 May 2009 14:45:02 -0000	1.1
+++ linux-2.6-mm-lru-dont-evict-mapped-executable-pages.patch	17 Jun 2009 00:10:29 -0000	1.2
@@ -1,10 +1,10 @@
-From: Wu Fengguang <fengguang.wu at intel.com>
-Subject: [PATCH -mm] vmscan: make mapped executable pages the first class citizen
-Date: Thu, 7 May 2009 20:11:01 +0800
-To: Andrew Morton <akpm at linux-foundation.org>
+vmscan: make mapped executable pages the first class citizen
 
-Introduce AS_EXEC to mark executables and their linked libraries, and to
-protect their referenced active pages from being deactivated.
+Protect referenced PROT_EXEC mapped pages from being deactivated.
+
+PROT_EXEC(or its internal presentation VM_EXEC) pages normally belong to some
+currently running executables and their linked libraries, they shall really be
+cached aggressively to provide good user experiences.
 
 CC: Elladan <elladan at eskimo.com>
 CC: Nick Piggin <npiggin at suse.de>
@@ -15,90 +15,51 @@ Acked-by: Peter Zijlstra <peterz at infrade
 Acked-by: Rik van Riel <riel at redhat.com>
 Signed-off-by: Wu Fengguang <fengguang.wu at intel.com>
 ---
- include/linux/pagemap.h |    1 +
- mm/mmap.c               |    2 ++
- mm/nommu.c              |    2 ++
- mm/vmscan.c             |   35 +++++++++++++++++++++++++++++++++--
- 4 files changed, 38 insertions(+), 2 deletions(-)
-
---- linux.orig/include/linux/pagemap.h
-+++ linux/include/linux/pagemap.h
-@@ -25,6 +25,7 @@ enum mapping_flags {
- #ifdef CONFIG_UNEVICTABLE_LRU
- 	AS_UNEVICTABLE	= __GFP_BITS_SHIFT + 3,	/* e.g., ramdisk, SHM_LOCK */
- #endif
-+	AS_EXEC		= __GFP_BITS_SHIFT + 4,	/* mapped PROT_EXEC somewhere */
- };
-
-
-static inline void mapping_set_error(struct address_space *mapping, int error)
-
---- linux.orig/mm/mmap.c
-+++ linux/mm/mmap.c
-@@ -1194,6 +1194,8 @@ munmap_back:
- 			goto unmap_and_free_vma;
- 		if (vm_flags & VM_EXECUTABLE)
- 			added_exe_file_vma(mm);
-+		if (vm_flags & VM_EXEC)
-+			set_bit(AS_EXEC, &file->f_mapping->flags);
- 	} else if (vm_flags & VM_SHARED) {
- 		error = shmem_zero_setup(vma);
- 		if (error)
---- linux.orig/mm/nommu.c
-+++ linux/mm/nommu.c
-@@ -1224,6 +1224,8 @@ unsigned long do_mmap_pgoff(struct file
- 			added_exe_file_vma(current->mm);
- 			vma->vm_mm = current->mm;
- 		}
-+		if (vm_flags & VM_EXEC)
-+			set_bit(AS_EXEC, &file->f_mapping->flags);
- 	}
+ mm/vmscan.c |   33 +++++++++++++++++++++++++++++++--
+ 1 file changed, 31 insertions(+), 2 deletions(-)
 
- 	down_write(&nommu_region_sem);
 --- linux.orig/mm/vmscan.c
 +++ linux/mm/vmscan.c
-@@ -1230,6 +1230,7 @@ static void shrink_active_list(unsigned
- 	unsigned long pgmoved;
+@@ -1233,6 +1233,7 @@ static void shrink_active_list(unsigned 
  	unsigned long pgscanned;
+ 	unsigned long vm_flags;
  	LIST_HEAD(l_hold);	/* The pages which were snipped off */
 +	LIST_HEAD(l_active);
  	LIST_HEAD(l_inactive);
  	struct page *page;
  	struct pagevec pvec;
-@@ -1269,8 +1270,15 @@ static void shrink_active_list(unsigned
-
+@@ -1272,8 +1273,13 @@ static void shrink_active_list(unsigned 
+ 
  		/* page_referenced clears PageReferenced */
  		if (page_mapping_inuse(page) &&
--		    page_referenced(page, 0, sc->mem_cgroup))
-+		    page_referenced(page, 0, sc->mem_cgroup)) {
-+			struct address_space *mapping = page_mapping(page);
-+
+-		    page_referenced(page, 0, sc->mem_cgroup, &vm_flags))
++		    page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) {
  			pgmoved++;
-+			if (mapping && test_bit(AS_EXEC, &mapping->flags)) {
++			if ((vm_flags & VM_EXEC) && !PageAnon(page)) {
 +				list_add(&page->lru, &l_active);
 +				continue;
 +			}
 +		}
-
+ 
  		list_add(&page->lru, &l_inactive);
  	}
-@@ -1279,7 +1287,6 @@ static void shrink_active_list(unsigned
+@@ -1282,7 +1288,6 @@ static void shrink_active_list(unsigned 
  	 * Move the pages to the [file or anon] inactive list.
  	 */
  	pagevec_init(&pvec, 1);
 -	lru = LRU_BASE + file * LRU_FILE;
-
+ 
  	spin_lock_irq(&zone->lru_lock);
  	/*
-@@ -1291,6 +1298,7 @@ static void shrink_active_list(unsigned
+@@ -1294,6 +1299,7 @@ static void shrink_active_list(unsigned 
  	reclaim_stat->recent_rotated[!!file] += pgmoved;
-
+ 
  	pgmoved = 0;
 +	lru = LRU_BASE + file * LRU_FILE;
  	while (!list_empty(&l_inactive)) {
  		page = lru_to_page(&l_inactive);
  		prefetchw_prev_lru_page(page, &l_inactive, flags);
-@@ -1313,6 +1321,29 @@ static void shrink_active_list(unsigned
+@@ -1316,6 +1322,29 @@ static void shrink_active_list(unsigned 
  	}
  	__count_zone_vm_events(PGREFILL, zone, pgscanned);
  	__count_vm_events(PGDEACTIVATE, pgdeactivate);
@@ -128,3 +89,4 @@ static inline void mapping_set_error(str
  	spin_unlock_irq(&zone->lru_lock);
  	if (vm_swap_full())
  		pagevec_swap_free(&pvec);
+

linux-2.6-mm-lru-evict-streaming-io-pages-first.patch:

Index: linux-2.6-mm-lru-evict-streaming-io-pages-first.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/linux-2.6-mm-lru-evict-streaming-io-pages-first.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- linux-2.6-mm-lru-evict-streaming-io-pages-first.patch	8 May 2009 14:45:02 -0000	1.1
+++ linux-2.6-mm-lru-evict-streaming-io-pages-first.patch	17 Jun 2009 00:10:29 -0000	1.2
@@ -13,7 +13,8 @@ IO, or allocated for something else. If 
 streaming IO, this pageout pattern continues. Otherwise, we will
 fall back to the normal pageout pattern.
 
-Signed-off-by: Rik van Riel <riel at redhat.com>
+Signed-off-by: Rik van Riel <riel redhat com>
+
 
 diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
 index a9e3b76..dbfe7ba 100644




More information about the fedora-extras-commits mailing list