pentoo-sources: fixed the swap issue as requested

This commit is contained in:
Zero_Chaos 2010-10-11 19:11:17 +00:00
parent caf6a4d0f9
commit 4e841bddee
3 changed files with 73 additions and 1 deletions

View file

@ -1,4 +1,5 @@
AUX 4001-ath5k-retain-promiscuous-setting.patch 803 RMD160 8d4a4c05b0ac5977d7efa957ecd01b6bf1fc809c SHA1 7fec19528d2969fce7ea67ed120e17cd6b984777 SHA256 4bd3b1839b47d29b03d4af1067a6c50d4e763a87827c692d18cbad672399b414
AUX 9997-desktop-responsiveness_2.6.35_fix.patch 2342 RMD160 6c724d430535d1a6349f045ea7a5cb9de50d4659 SHA1 95013ff10dda420c94a192f354804f1f0a6d07b5 SHA256 ce80fcca23d3869c10a0be3d85510c75805786bdda27d51578a2298b99ba64eb
AUX openfile_log.patch 732 RMD160 7c7a51381026e766095fe125f3092a23a456eb1e SHA1 11d958a6da186bc4429c481bf5b3ba66ef3b8265 SHA256 a4539dcdc9fb70d7f2c87f1e41b72c10930c49d025bd82563d0c9ee9982345af
DIST deblob-2.6.28 72502 RMD160 a3f0a12e0c6312dfc7cacd0e81a50e57519b8df3 SHA1 5a7fb26f3c0c9855bb85431fa29fc285a19f7346 SHA256 432213f8caf6dc534a68dfb321dd33177f93c2fbdd57928a61e49947dd49f25c
DIST deblob-2.6.29 76155 RMD160 b56288e338c16ec6aafd5d9146bd4dc8ae82d2ba SHA1 ab846a78ee43e2efd90417494cafe9dfa5b2d089 SHA256 ce0805a2767a1139fd952232eae04814c8910d0629963c2dc1e83449bc6a4987
@ -70,4 +71,4 @@ EBUILD pentoo-sources-2.6.34-r2.ebuild 1296 RMD160 0ef534662d815e9ddd7bac9b706ec
EBUILD pentoo-sources-2.6.34-r3.ebuild 1296 RMD160 71502e8d83e20a744527e6eb2f5322ef84a430e7 SHA1 acace20c5e572829f225ac3477f9bf87171959dd SHA256 8bbb789426a4a2fdd64f3b52a656e93b80818c02b913e8906282dd33b0c0d097
EBUILD pentoo-sources-2.6.34-r6.ebuild 2139 RMD160 e68415d156cc08534ab8374bb95a8006f32df612 SHA1 5c083cb294f98f469f6795482b04dad6b567431f SHA256 2edac335e2557a4c7da37c2500f59e371a10ed513a51f150564cdd08493a7ec4
EBUILD pentoo-sources-2.6.35-r6.ebuild 2184 RMD160 fb6f03f93b5695a602e0820bc9b6c7db508bf45a SHA1 a3426cce95d55726206a3d661f08f61eae32ba49 SHA256 bdd82b9bf68390d503ea39ec717cd2f1215de06456ae4f112afba35fd4377612
EBUILD pentoo-sources-2.6.35-r7.ebuild 2184 RMD160 cc5bf7f14d244e1456365380af9f6c0c2de3cfb4 SHA1 f2b0fa8df3d17945e83e094bfaa4cb22e748c402 SHA256 3c287983553fbbf3a16d0f2191744e47d6f740fda8d5f8355065180dbad8b44d
EBUILD pentoo-sources-2.6.35-r7.ebuild 2276 RMD160 f1f305d74396bd2f147a252df1685a48df90cfdb SHA1 83a72123805e9a40a022b5e2751594c07ecac6ff SHA256 79966293169ced50da5e5a58d680218285fed5ddbc5cdc1038a310dfd5f86b6e

View file

@ -0,0 +1,69 @@
diff -Naur linux-2.6.35-pentoo-r7/mm/vmscan.c linux-2.6.35-pentoo-r7-fixed/mm/vmscan.c
--- linux-2.6.35-pentoo-r7/mm/vmscan.c 2010-10-11 09:55:13.000000000 -0400
+++ linux-2.6.35-pentoo-r7-fixed/mm/vmscan.c 2010-10-11 14:50:35.000000000 -0400
@@ -1112,6 +1112,47 @@
}
/*
+ * Returns true if the caller should wait to clean dirty/writeback pages.
+ *
+ * If we are direct reclaiming for contiguous pages and we do not reclaim
+ * everything in the list, try again and wait for writeback IO to complete.
+ * This will stall high-order allocations noticeably. Only do that when really
+ * need to free the pages under high memory pressure.
+ */
+static inline bool should_reclaim_stall(unsigned long nr_taken,
+ unsigned long nr_freed,
+ int priority,
+ struct scan_control *sc)
+{
+ int lumpy_stall_priority;
+
+ /* kswapd should not stall on sync IO */
+ if (current_is_kswapd())
+ return false;
+
+ /* Only stall on lumpy reclaim */
+ if (!sc->lumpy_reclaim_mode)
+ return false;
+
+ /* If we have relaimed everything on the isolated list, no stall */
+ if (nr_freed == nr_taken)
+ return false;
+
+ /*
+ * For high-order allocations, there are two stall thresholds.
+ * High-cost allocations stall immediately where as lower
+ * order allocations such as stacks require the scanning
+ * priority to be much higher before stalling.
+ */
+ if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
+ lumpy_stall_priority = DEF_PRIORITY;
+ else
+ lumpy_stall_priority = DEF_PRIORITY / 3;
+
+ return priority <= lumpy_stall_priority;
+}
+
+/*
* shrink_inactive_list() is a helper for shrink_zone(). It returns the number
* of reclaimed pages
*/
@@ -1201,15 +1242,8 @@
nr_scanned += nr_scan;
nr_freed = shrink_page_list(&page_list, sc, PAGEOUT_IO_ASYNC);
- /*
- * If we are direct reclaiming for contiguous pages and we do
- * not reclaim everything in the list, try again and wait
- * for IO to complete. This will stall high-order allocations
- * but that should be acceptable to the caller
- */
- if (nr_freed < nr_taken && !current_is_kswapd() &&
- sc->lumpy_reclaim_mode) {
- congestion_wait(BLK_RW_ASYNC, HZ/10);
+ /* Check if we should syncronously wait for writeback */
+ if (should_reclaim_stall(nr_taken, nr_freed, priority, sc)) {
/*
* The attempt at page out may have made some

View file

@ -45,8 +45,10 @@ pkg_setup() {
4422_grsec-mute-warnings.patch"
fi
use openfile_log && UNIPATCH_LIST="${UNIPATCH_LIST} ${FILESDIR}/openfile_log.patch"
UNIPATCH_LIST="${UNIPATCH_LIST} ${FILESDIR}/9997-desktop-responsiveness_2.6.35_fix.patch"
}
pkg_postinst() {
kernel-2_pkg_postinst
einfo "For more info on this patchset, and how to report problems, see:"