From: Greg Kroah-Hartman Date: Fri, 1 Jun 2012 08:20:27 +0000 (+0800) Subject: 3.0-stable patches X-Git-Tag: v3.0.34~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3619766e8ac36ed64fadfa7581ba9c7fcce1458;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: mm-consider-all-swapped-back-pages-in-used-once-logic.patch scsi-fix-dm-multipath-starvation-when-scsi-host-is-busy.patch scsi-fix-scsi_wait_scan.patch --- diff --git a/queue-3.0/mm-consider-all-swapped-back-pages-in-used-once-logic.patch b/queue-3.0/mm-consider-all-swapped-back-pages-in-used-once-logic.patch new file mode 100644 index 00000000000..ee1ed3f6d0b --- /dev/null +++ b/queue-3.0/mm-consider-all-swapped-back-pages-in-used-once-logic.patch @@ -0,0 +1,63 @@ +From e48982734ea0500d1eba4f9d96195acc5406cad6 Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Tue, 29 May 2012 15:06:45 -0700 +Subject: mm: consider all swapped back pages in used-once logic + +From: Michal Hocko + +commit e48982734ea0500d1eba4f9d96195acc5406cad6 upstream. + +Commit 645747462435 ("vmscan: detect mapped file pages used only once") +made mapped pages have another round in inactive list because they might +be just short lived and so we could consider them again next time. This +heuristic helps to reduce pressure on the active list with a streaming +IO worklods. + +This patch fixes a regression introduced by this commit for heavy shmem +based workloads because unlike Anon pages, which are excluded from this +heuristic because they are usually long lived, shmem pages are handled +as a regular page cache. + +This doesn't work quite well, unfortunately, if the workload is mostly +backed by shmem (in memory database sitting on 80% of memory) with a +streaming IO in the background (backup - up to 20% of memory). Anon +inactive list is full of (dirty) shmem pages when watermarks are hit. +Shmem pages are kept in the inactive list (they are referenced) in the +first round and it is hard to reclaim anything else so we reach lower +scanning priorities very quickly which leads to an excessive swap out. + +Let's fix this by excluding all swap backed pages (they tend to be long +lived wrt. the regular page cache anyway) from used-once heuristic and +rather activate them if they are referenced. + +The customer's workload is shmem backed database (80% of RAM) and they +are measuring transactions/s with an IO in the background (20%). +Transactions touch more or less random rows in the table. The +transaction rate fell by a factor of 3 (in the worst case) because of +commit 64574746. This patch restores the previous numbers. + +Signed-off-by: Michal Hocko +Acked-by: Johannes Weiner +Cc: Mel Gorman +Cc: Minchan Kim +Cc: KAMEZAWA Hiroyuki +Reviewed-by: Rik van Riel +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/vmscan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -665,7 +665,7 @@ static enum page_references page_check_r + return PAGEREF_RECLAIM; + + if (referenced_ptes) { +- if (PageAnon(page)) ++ if (PageSwapBacked(page)) + return PAGEREF_ACTIVATE; + /* + * All mapped pages start out with page table diff --git a/queue-3.0/scsi-fix-dm-multipath-starvation-when-scsi-host-is-busy.patch b/queue-3.0/scsi-fix-dm-multipath-starvation-when-scsi-host-is-busy.patch new file mode 100644 index 00000000000..ef2ceacd7f6 --- /dev/null +++ b/queue-3.0/scsi-fix-dm-multipath-starvation-when-scsi-host-is-busy.patch @@ -0,0 +1,59 @@ +From b7e94a1686c5daef4f649f7f4f839cc294f07710 Mon Sep 17 00:00:00 2001 +From: Jun'ichi Nomura +Date: Tue, 22 May 2012 18:57:17 +0900 +Subject: SCSI: Fix dm-multipath starvation when scsi host is busy + +From: Jun'ichi Nomura + +commit b7e94a1686c5daef4f649f7f4f839cc294f07710 upstream. + +block congestion control doesn't have any concept of fairness across +multiple queues. This means that if SCSI reports the host as busy in +the queue congestion control it can result in an unfair starvation +situation in dm-mp if there are multiple multipath devices on the same +host. For example: +http://www.redhat.com/archives/dm-devel/2012-May/msg00123.html + +The fix for this is to report only the sdev busy state (and ignore the +host busy state) in the block congestion control call back. +The host is still congested, but the SCSI subsystem will sort out the +congestion in a fair way because it knows the relation between the +queues and the host. + +[jejb: fixed up trailing whitespace] +Reported-by: Bernd Schubert +Tested-by: Bernd Schubert +Signed-off-by: Jun'ichi Nomura +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/scsi_lib.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/scsi_lib.c ++++ b/drivers/scsi/scsi_lib.c +@@ -1380,16 +1380,19 @@ static int scsi_lld_busy(struct request_ + { + struct scsi_device *sdev = q->queuedata; + struct Scsi_Host *shost; +- struct scsi_target *starget; + + if (!sdev) + return 0; + + shost = sdev->host; +- starget = scsi_target(sdev); + +- if (scsi_host_in_recovery(shost) || scsi_host_is_busy(shost) || +- scsi_target_is_busy(starget) || scsi_device_is_busy(sdev)) ++ /* ++ * Ignore host/starget busy state. ++ * Since block layer does not have a concept of fairness across ++ * multiple queues, congestion of host/starget needs to be handled ++ * in SCSI layer. ++ */ ++ if (scsi_host_in_recovery(shost) || scsi_device_is_busy(sdev)) + return 1; + + return 0; diff --git a/queue-3.0/scsi-fix-scsi_wait_scan.patch b/queue-3.0/scsi-fix-scsi_wait_scan.patch new file mode 100644 index 00000000000..b3b8d1ea862 --- /dev/null +++ b/queue-3.0/scsi-fix-scsi_wait_scan.patch @@ -0,0 +1,42 @@ +From 1ff2f40305772b159a91c19590ee159d3a504afc Mon Sep 17 00:00:00 2001 +From: James Bottomley +Date: Wed, 30 May 2012 09:45:39 +0000 +Subject: SCSI: fix scsi_wait_scan + +From: James Bottomley + +commit 1ff2f40305772b159a91c19590ee159d3a504afc upstream. + +Commit c751085943362143f84346d274e0011419c84202 +Author: Rafael J. Wysocki +Date: Sun Apr 12 20:06:56 2009 +0200 + + PM/Hibernate: Wait for SCSI devices scan to complete during resume + +Broke the scsi_wait_scan module in 2.6.30. Apparently debian still uses it so +fix it and backport to stable before removing it in 3.6. + +The breakage is caused because the function template in +include/scsi/scsi_scan.h is defined to be a nop unless SCSI is built in. +That means that in the modular case (which is every distro), the +scsi_wait_scan module does a simple async_synchronize_full() instead of +waiting for scans. + +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/scsi_wait_scan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/scsi_wait_scan.c ++++ b/drivers/scsi/scsi_wait_scan.c +@@ -12,7 +12,7 @@ + + #include + #include +-#include ++#include "scsi_priv.h" + + static int __init wait_scan_init(void) + { diff --git a/queue-3.0/series b/queue-3.0/series new file mode 100644 index 00000000000..b6921bb5b52 --- /dev/null +++ b/queue-3.0/series @@ -0,0 +1,3 @@ +scsi-fix-scsi_wait_scan.patch +scsi-fix-dm-multipath-starvation-when-scsi-host-is-busy.patch +mm-consider-all-swapped-back-pages-in-used-once-logic.patch