Description of problem: patching file mm/vmscan.c Hunk #1 succeeded at 917 (offset 24 lines). Hunk #2 FAILED at 973. Hunk #3 succeeded at 1029 (offset -5 lines). Hunk #4 succeeded at 1183 (offset 1 line). Hunk #5 succeeded at 1186 (offset -5 lines). Hunk #6 succeeded at 1217 (offset 1 line). Hunk #7 FAILED at 1264. Hunk #8 FAILED at 1291. Hunk #9 succeeded at 1298 (offset -5 lines). 3 out of 9 hunks FAILED -- saving rejects to file mm/vmscan.c.rej ... except hunk #5 was not actually applied, but instead silently lost. Version-Release number of selected component (if applicable): patch-2.5.4-32.fc9.x86_64 How reproducible: Attached are: 1) the original vmscan.c 2) patch file with chunk #5 failing silently Steps to Reproduce: 1. try to apply the patch to vmscan.c
Created attachment 308628 [details] vmscan.c
Created attachment 308629 [details] patch that caused the problem
Can't reproduce that here I'm afraid: [tim@worm ~]$ filterdiff -i '*/vmscan.c' --hunk=5 rvr-04-linux-2.6-scan-ratio-fixes.patch --- linux-2.6.26-rc2-mm1.orig/mm/vmscan.c 2008-05-28 12:11:38.000000000 -0400 +++ linux-2.6.26-rc2-mm1/mm/vmscan.c 2008-05-28 12:11:51.000000000 -0400 @@ -1180,15 +1180,19 @@ static void get_scan_ratio(struct zone * file = zone_page_state(zone, NR_ACTIVE_FILE) + zone_page_state(zone, NR_INACTIVE_FILE); - rotate_sum = zone->recent_rotated_file + zone->recent_rotated_anon; - /* Keep a floating average of RECENT references. */ - if (unlikely(rotate_sum > min(anon, file))) { + if (unlikely(zone->recent_scanned_anon > anon / zone->inactive_ratio)) { spin_lock_irq(&zone->lru_lock); - zone->recent_rotated_file /= 2; + zone->recent_scanned_anon /= 2; zone->recent_rotated_anon /= 2; spin_unlock_irq(&zone->lru_lock); - rotate_sum /= 2; + } + + if (unlikely(zone->recent_scanned_file > file / 4)) { + spin_lock_irq(&zone->lru_lock); + zone->recent_scanned_file /= 2; + zone->recent_rotated_file /= 2; + spin_unlock_irq(&zone->lru_lock); } /* [tim@worm ~]$ sha1sum vmscan.c rvr-04-linux-2.6-scan-ratio-fixes.patch 1a23376211c806e76cadd42729aac9168bcd8f1f vmscan.c ff060add298b5da766615361c5af8943e4cb6e4a rvr-04-linux-2.6-scan-ratio-fixes.patch [tim@worm ~]$ filterdiff -i '*/vmscan.c' rvr-04-linux-2.6-scan-ratio-fixes.patch | patch vmscan.c patching file vmscan.c Hunk #1 succeeded at 917 (offset 24 lines). Hunk #2 FAILED at 973. Hunk #3 succeeded at 1029 (offset -5 lines). Hunk #4 succeeded at 1183 (offset 1 line). Hunk #5 succeeded at 1186 (offset -5 lines). Hunk #6 succeeded at 1217 (offset 1 line). Hunk #7 FAILED at 1264. Hunk #8 FAILED at 1291. Hunk #9 succeeded at 1298 (offset -5 lines). 3 out of 9 hunks FAILED -- saving rejects to file vmscan.c.rej [tim@worm ~]$ sed -ne '1185,1203p' vmscan.c file = zone_page_state(zone, NR_ACTIVE_FILE) + zone_page_state(zone, NR_INACTIVE_FILE); /* Keep a floating average of RECENT references. */ if (unlikely(zone->recent_scanned_anon > anon / zone->inactive_ratio)) { spin_lock_irq(&zone->lru_lock); zone->recent_scanned_anon /= 2; zone->recent_rotated_anon /= 2; spin_unlock_irq(&zone->lru_lock); } if (unlikely(zone->recent_scanned_file > file / 4)) { spin_lock_irq(&zone->lru_lock); zone->recent_scanned_file /= 2; zone->recent_rotated_file /= 2; spin_unlock_irq(&zone->lru_lock); } /* [tim@worm ~]$ rpm -q patch patch-2.5.4-32.fc9.x86_64