diff --git a/sys-kernel/linux-sabayon-sources/Manifest b/sys-kernel/linux-sabayon-sources/Manifest index db3864a65..bd1a520f5 100644 --- a/sys-kernel/linux-sabayon-sources/Manifest +++ b/sys-kernel/linux-sabayon-sources/Manifest @@ -1,3 +1,4 @@ +AUX 2.6.31/cfq-iosched-IO-latency.patch 3363 RMD160 2f65f79c75b6562c5ba1e7164bce9cd211a4ffd9 SHA1 f16c0bea0a8e8ccb42285273dfaa65d2964eed69 SHA256 c15487140738ce18a6561dec82a47608e8c2b7c6005b8aa57a33438eba34b784 AUX linux-sabayon-2.6.30-amd64.config 98191 RMD160 7e2948bb13edc151f91b63a624a2f4cc21c7261d SHA1 8ea7a47d4a2aec1b7b67f2a2e4386d4fc443958d SHA256 6afae88026d5a5df60d668488840ac34d40967b4c9e767a4bf06f94206a3624a AUX linux-sabayon-2.6.30-r1-amd64.config 98191 RMD160 7e2948bb13edc151f91b63a624a2f4cc21c7261d SHA1 8ea7a47d4a2aec1b7b67f2a2e4386d4fc443958d SHA256 6afae88026d5a5df60d668488840ac34d40967b4c9e767a4bf06f94206a3624a AUX linux-sabayon-2.6.30-r1-x86.config 103442 RMD160 8ce9f61aaadab2301aae7e422e8697836f22ca9c SHA1 e730e8fc75d5092e76ce4aaec4ed11afbef064b2 SHA256 5c8448e742dbb5b5741711d13eb1a50ece07f664656c530cbb4abd2e46bf040a @@ -10,4 +11,4 @@ DIST linux-2.6.30.tar.bz2 59435895 RMD160 72219f992c6266dfe78c6d803d0506c9db1e45 DIST linux-2.6.31.tar.bz2 61494822 RMD160 c0d88e63740abf0d4f9d82557260a31643f5a01b SHA1 c6e0e6b473ba2b80d164e37cfabf294e783c03d9 SHA256 0acd83f7b85db7ee18c2b0b7505e1ba6fd722c36f49a8870a831c851660e3512 EBUILD linux-sabayon-sources-2.6.30-r1.ebuild 1351 RMD160 2dd6a66325194f06f67540484c5bf30458beea86 SHA1 e16eb2851bf962ab043c583436962f2cba33cd3e SHA256 7eec47aeda07f7dea2a25de768cdbae51112a4d7d96fd8bdb2b8022078f4a74c EBUILD linux-sabayon-sources-2.6.30.ebuild 1214 RMD160 7fbaad9322b0fbb6178f8af4a41360fc15174386 SHA1 513fbd288805eb9daa38dbbe4c2eca1bfc13a497 SHA256 5ec6ca955bf55396a6a0483369f6b64bc6293977dc6a22abd4c2972e8823bdb8 -EBUILD linux-sabayon-sources-2.6.31.ebuild 1490 RMD160 984a8b094bed95ae7e8b5fa5923c1a32e813506f SHA1 3fa5e28f6162c5d78c5eac730d2cd4bcf59ebf3e SHA256 625ad3297c06957bf95527e53eb76e6a077956d46ebbd1f6365cafe0a6386480 +EBUILD linux-sabayon-sources-2.6.31.ebuild 1541 RMD160 abda0a7a2df7264385144219fb2ff9d16dfc7847 SHA1 f89d59a4aa78746c3c5d10f3fb388568af488c85 SHA256 d9a88095073a39c607cbea4f10ccd05f62597b0069774b7de464a09d6907373a diff --git a/sys-kernel/linux-sabayon-sources/files/2.6.31/cfq-iosched-IO-latency.patch b/sys-kernel/linux-sabayon-sources/files/2.6.31/cfq-iosched-IO-latency.patch new file mode 100644 index 000000000..0f10f8220 --- /dev/null +++ b/sys-kernel/linux-sabayon-sources/files/2.6.31/cfq-iosched-IO-latency.patch @@ -0,0 +1,112 @@ +diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c +index 87276eb..57ed6fc 100644 +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -140,7 +140,7 @@ struct cfq_data { + */ + unsigned int busy_rt_queues; + +- int rq_in_driver; ++ int rq_in_driver[2]; + int sync_flight; + + /* +@@ -239,6 +239,11 @@ static struct cfq_queue *cfq_get_queue(struct cfq_data *, int, + static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *, + struct io_context *); + ++static inline int rq_in_driver(struct cfq_data *cfqd) ++{ ++ return cfqd->rq_in_driver[0] + cfqd->rq_in_driver[1]; ++} ++ + static inline struct cfq_queue *cic_to_cfqq(struct cfq_io_context *cic, + int is_sync) + { +@@ -760,9 +765,9 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; + +- cfqd->rq_in_driver++; ++ cfqd->rq_in_driver[rq_is_sync(rq)]++; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + + cfqd->last_position = blk_rq_pos(rq) + blk_rq_sectors(rq); + } +@@ -770,11 +775,12 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + static void cfq_deactivate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; ++ const int sync = rq_is_sync(rq); + +- WARN_ON(!cfqd->rq_in_driver); +- cfqd->rq_in_driver--; ++ WARN_ON(!cfqd->rq_in_driver[sync]); ++ cfqd->rq_in_driver[sync]--; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "deactivate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + } + + static void cfq_remove_request(struct request *rq) +@@ -1080,7 +1086,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd) + /* + * still requests with the driver, don't idle + */ +- if (cfqd->rq_in_driver) ++ if (rq_in_driver(cfqd)) + return; + + /* +@@ -1312,6 +1318,12 @@ static int cfq_dispatch_requests(struct request_queue *q, int force) + return 0; + + /* ++ * Drain async requests before we start sync IO ++ */ ++ if (cfq_cfqq_idle_window(cfqq) && cfqd->rq_in_driver[BLK_RW_ASYNC]) ++ return 0; ++ ++ /* + * If this is an async queue and we have sync IO in flight, let it wait + */ + if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq)) +@@ -2130,11 +2142,11 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq) + */ + static void cfq_update_hw_tag(struct cfq_data *cfqd) + { +- if (cfqd->rq_in_driver > cfqd->rq_in_driver_peak) +- cfqd->rq_in_driver_peak = cfqd->rq_in_driver; ++ if (rq_in_driver(cfqd) > cfqd->rq_in_driver_peak) ++ cfqd->rq_in_driver_peak = rq_in_driver(cfqd); + + if (cfqd->rq_queued <= CFQ_HW_QUEUE_MIN && +- cfqd->rq_in_driver <= CFQ_HW_QUEUE_MIN) ++ rq_in_driver(cfqd) <= CFQ_HW_QUEUE_MIN) + return; + + if (cfqd->hw_tag_samples++ < 50) +@@ -2161,9 +2173,9 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + + cfq_update_hw_tag(cfqd); + +- WARN_ON(!cfqd->rq_in_driver); ++ WARN_ON(!cfqd->rq_in_driver[sync]); + WARN_ON(!cfqq->dispatched); +- cfqd->rq_in_driver--; ++ cfqd->rq_in_driver[sync]--; + cfqq->dispatched--; + + if (cfq_cfqq_sync(cfqq)) +@@ -2197,7 +2209,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + cfq_arm_slice_timer(cfqd); + } + +- if (!cfqd->rq_in_driver) ++ if (!rq_in_driver(cfqd)) + cfq_schedule_dispatch(cfqd); + } + + diff --git a/sys-kernel/linux-sabayon-sources/linux-sabayon-sources-2.6.31.ebuild b/sys-kernel/linux-sabayon-sources/linux-sabayon-sources-2.6.31.ebuild index 7000699ef..e1997ed4a 100644 --- a/sys-kernel/linux-sabayon-sources/linux-sabayon-sources-2.6.31.ebuild +++ b/sys-kernel/linux-sabayon-sources/linux-sabayon-sources-2.6.31.ebuild @@ -26,7 +26,10 @@ SLOT="${PV}" S="${WORKDIR}/linux-${KV_FULL}" # patches -UNIPATCH_LIST="${DISTFILES}/${K_SABPATCHES_PKG}" +UNIPATCH_LIST=" + ${DISTFILES}/${K_SABPATCHES_PKG} + ${FILESDIR}/${PV}/cfq-iosched-IO-latency.patch +" src_unpack() { diff --git a/sys-kernel/linux-sabayon/Manifest b/sys-kernel/linux-sabayon/Manifest index ce2e71908..03b0d2df1 100644 --- a/sys-kernel/linux-sabayon/Manifest +++ b/sys-kernel/linux-sabayon/Manifest @@ -13,6 +13,7 @@ AUX 2.6.29/mactel/2-bcm5974-quad-finger-tapping.patch 2014 RMD160 8ae24293dd608d AUX 2.6.29/mactel/3-bcm5974-macbook5-support.patch 4515 RMD160 e69c5aa44b925c76995b5a040327b2ed4b7acc79 SHA1 62a729437a289cd7474d202dbe3fac0607152a83 SHA256 c1f5027fa74591123ff38968aceb9df715a40922efc865ec2ae2b58b728c49cd AUX 2.6.29/patch-2.6.29.1.bz2 14395 RMD160 78b2817db8a001750648ee4609a94de26829a4bc SHA1 de0c8efa7927fca5c95dce0e1a47e354527a6c52 SHA256 0c44a41816082602f9d2bd45524d85f6e5fa8e4a6a9a15861048ca2aaf068d8f AUX 2.6.29/patch-2.6.29.4.bz2 91866 RMD160 cc42e56685043b6e197d3ca3040cddfb8f3f0ee6 SHA1 7bdd162dd922a54d1b73eb4ab86bdee6dd27f68a SHA256 eb5889a4b0438d682c9136c9bdbeeb157d375b1538d46c39114c448312526020 +AUX 2.6.31/cfq-iosched-IO-latency.patch 3363 RMD160 2f65f79c75b6562c5ba1e7164bce9cd211a4ffd9 SHA1 f16c0bea0a8e8ccb42285273dfaa65d2964eed69 SHA256 c15487140738ce18a6561dec82a47608e8c2b7c6005b8aa57a33438eba34b784 AUX linux-sabayon-2.6.29-amd64.config 94715 RMD160 655f56011eb7ff35edaf8362d2c7dc1d251c5566 SHA1 2f91aabc7c0a3e6f46b7e51d3f3a1518f2d356ae SHA256 7b6fe34a34de01810d9640ea0d1034ac6106d21ca39a670a06eb8edb78023639 AUX linux-sabayon-2.6.29-r1-amd64.config 94715 RMD160 655f56011eb7ff35edaf8362d2c7dc1d251c5566 SHA1 2f91aabc7c0a3e6f46b7e51d3f3a1518f2d356ae SHA256 7b6fe34a34de01810d9640ea0d1034ac6106d21ca39a670a06eb8edb78023639 AUX linux-sabayon-2.6.29-r1-x86.config 99693 RMD160 e060ec6b3e22e1fccbbd4794754bc6894217b0e1 SHA1 39350f04ab3d397bfc221ae8261d96043f4d330f SHA256 65b5429cd3ed3d68abfcb2fe5e8a69c41b4c0934067a50772c504801f09e6498 @@ -35,4 +36,4 @@ EBUILD linux-sabayon-2.6.29-r2.ebuild 5308 RMD160 ee7ca95f7e9b8cf757f2c502def441 EBUILD linux-sabayon-2.6.29.ebuild 5302 RMD160 eb4de93fc3061731abb7dad281fc54cad7febeaa SHA1 3f7261efa2acfb2d60b373b7292e0e3bec15af24 SHA256 356530463059c22e1c37946df06c5272b394a6940690a173777cc0bd8893ae06 EBUILD linux-sabayon-2.6.30-r1.ebuild 4912 RMD160 6213a478a22aa169607ce587927f197ddec7c8cf SHA1 ddcfea17ca82b43581c5580982913161fbfc209c SHA256 7ea4f63a46aa7a561788f3a946738b1ffd42d5a94ebf49ede64c697cde6b6d43 EBUILD linux-sabayon-2.6.30.ebuild 4906 RMD160 ba68cd5858ebbe9c9141564298b3bf1b28ca5614 SHA1 66759a5c4207015059b165945c1fcc5f571d1b39 SHA256 60cf1efdb1bbf5a3a5512a68921957ab60a2b4faa1af50a86ee50abc7ef6f3de -EBUILD linux-sabayon-2.6.31.ebuild 5570 RMD160 f38c7fdb1116e40f958fcfe35e6baf0e4c5bc247 SHA1 ff529c2d3b3fece10424717c44c5fdac80c7d31f SHA256 45cec94af51071a86f812e8eb2b35bde4cc8b52864453e82243053a856ced8ba +EBUILD linux-sabayon-2.6.31.ebuild 5621 RMD160 50f8ce3d5f74aae11a0cfb88ed24421f99b432f5 SHA1 ff72a60115f803ece5bae00268a212f8d3aba481 SHA256 03bc923589991c1bf974c0fb6123f3eee35e574564c0fd82bf9c13f26e110bd1 diff --git a/sys-kernel/linux-sabayon/files/2.6.31/cfq-iosched-IO-latency.patch b/sys-kernel/linux-sabayon/files/2.6.31/cfq-iosched-IO-latency.patch new file mode 100644 index 000000000..0f10f8220 --- /dev/null +++ b/sys-kernel/linux-sabayon/files/2.6.31/cfq-iosched-IO-latency.patch @@ -0,0 +1,112 @@ +diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c +index 87276eb..57ed6fc 100644 +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -140,7 +140,7 @@ struct cfq_data { + */ + unsigned int busy_rt_queues; + +- int rq_in_driver; ++ int rq_in_driver[2]; + int sync_flight; + + /* +@@ -239,6 +239,11 @@ static struct cfq_queue *cfq_get_queue(struct cfq_data *, int, + static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *, + struct io_context *); + ++static inline int rq_in_driver(struct cfq_data *cfqd) ++{ ++ return cfqd->rq_in_driver[0] + cfqd->rq_in_driver[1]; ++} ++ + static inline struct cfq_queue *cic_to_cfqq(struct cfq_io_context *cic, + int is_sync) + { +@@ -760,9 +765,9 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; + +- cfqd->rq_in_driver++; ++ cfqd->rq_in_driver[rq_is_sync(rq)]++; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + + cfqd->last_position = blk_rq_pos(rq) + blk_rq_sectors(rq); + } +@@ -770,11 +775,12 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + static void cfq_deactivate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; ++ const int sync = rq_is_sync(rq); + +- WARN_ON(!cfqd->rq_in_driver); +- cfqd->rq_in_driver--; ++ WARN_ON(!cfqd->rq_in_driver[sync]); ++ cfqd->rq_in_driver[sync]--; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "deactivate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + } + + static void cfq_remove_request(struct request *rq) +@@ -1080,7 +1086,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd) + /* + * still requests with the driver, don't idle + */ +- if (cfqd->rq_in_driver) ++ if (rq_in_driver(cfqd)) + return; + + /* +@@ -1312,6 +1318,12 @@ static int cfq_dispatch_requests(struct request_queue *q, int force) + return 0; + + /* ++ * Drain async requests before we start sync IO ++ */ ++ if (cfq_cfqq_idle_window(cfqq) && cfqd->rq_in_driver[BLK_RW_ASYNC]) ++ return 0; ++ ++ /* + * If this is an async queue and we have sync IO in flight, let it wait + */ + if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq)) +@@ -2130,11 +2142,11 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq) + */ + static void cfq_update_hw_tag(struct cfq_data *cfqd) + { +- if (cfqd->rq_in_driver > cfqd->rq_in_driver_peak) +- cfqd->rq_in_driver_peak = cfqd->rq_in_driver; ++ if (rq_in_driver(cfqd) > cfqd->rq_in_driver_peak) ++ cfqd->rq_in_driver_peak = rq_in_driver(cfqd); + + if (cfqd->rq_queued <= CFQ_HW_QUEUE_MIN && +- cfqd->rq_in_driver <= CFQ_HW_QUEUE_MIN) ++ rq_in_driver(cfqd) <= CFQ_HW_QUEUE_MIN) + return; + + if (cfqd->hw_tag_samples++ < 50) +@@ -2161,9 +2173,9 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + + cfq_update_hw_tag(cfqd); + +- WARN_ON(!cfqd->rq_in_driver); ++ WARN_ON(!cfqd->rq_in_driver[sync]); + WARN_ON(!cfqq->dispatched); +- cfqd->rq_in_driver--; ++ cfqd->rq_in_driver[sync]--; + cfqq->dispatched--; + + if (cfq_cfqq_sync(cfqq)) +@@ -2197,7 +2209,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + cfq_arm_slice_timer(cfqd); + } + +- if (!cfqd->rq_in_driver) ++ if (!rq_in_driver(cfqd)) + cfq_schedule_dispatch(cfqd); + } + + diff --git a/sys-kernel/linux-sabayon/linux-sabayon-2.6.31.ebuild b/sys-kernel/linux-sabayon/linux-sabayon-2.6.31.ebuild index 0a9f101fc..5efd6a07b 100644 --- a/sys-kernel/linux-sabayon/linux-sabayon-2.6.31.ebuild +++ b/sys-kernel/linux-sabayon/linux-sabayon-2.6.31.ebuild @@ -34,7 +34,10 @@ SLOT="${PV}" S="${WORKDIR}/linux-${KV_FULL}" # patches -UNIPATCH_LIST="${DISTFILES}/${K_SABPATCHES_PKG}" +UNIPATCH_LIST=" + ${DISTFILES}/${K_SABPATCHES_PKG} + ${FILESDIR}/${PV}/cfq-iosched-IO-latency.patch +" src_unpack() { diff --git a/sys-kernel/linux-server/Manifest b/sys-kernel/linux-server/Manifest index 0a8df52c8..8ff0aa0e4 100644 --- a/sys-kernel/linux-server/Manifest +++ b/sys-kernel/linux-server/Manifest @@ -1,5 +1,6 @@ +AUX 2.6.31/cfq-iosched-IO-latency.patch 3363 RMD160 2f65f79c75b6562c5ba1e7164bce9cd211a4ffd9 SHA1 f16c0bea0a8e8ccb42285273dfaa65d2964eed69 SHA256 c15487140738ce18a6561dec82a47608e8c2b7c6005b8aa57a33438eba34b784 AUX linux-server-2.6.31-amd64.config 100571 RMD160 385f369ebe2ef37e4aa542c96420f1324969224e SHA1 8270d0df23a7d41e188deea5b0af24a7a7a6a4cd SHA256 dcaded6b2001e8c03e962cd65a79277a83892511c2464166a7f7627d4e1c280d AUX linux-server-2.6.31-x86.config 100842 RMD160 7c7f5a1350f53763b95dce2e6645402ed780d1c0 SHA1 817f467e4346bb64d33cc96d6cee046b6a3d8628 SHA256 301b169751ea1bba4eba5a3801292776e7f674cc3627dd307470e11a4a33f373 DIST 2.6.31-2.tar.bz2 268156 RMD160 6740fef6a150456c67fa0b51f6219edcd3b56253 SHA1 00671dbe2a72b735c2c0c84b30e353915d568233 SHA256 af977768a1aac5f55a84149a9d9bc72fe18b73fbee65b833b6c39109c27626c6 DIST linux-2.6.31.tar.bz2 61494822 RMD160 c0d88e63740abf0d4f9d82557260a31643f5a01b SHA1 c6e0e6b473ba2b80d164e37cfabf294e783c03d9 SHA256 0acd83f7b85db7ee18c2b0b7505e1ba6fd722c36f49a8870a831c851660e3512 -EBUILD linux-server-2.6.31.ebuild 5035 RMD160 4d2f6aab22b91524bfce09b5a9a47d2e6994ef18 SHA1 dbdd60046d14f8c8dfb06e26f1bb19983c8ac94d SHA256 2938de341c362f4907f959a6a629e1921eb3ee76036f03b5be86df7554da4a99 +EBUILD linux-server-2.6.31.ebuild 5145 RMD160 81ee702c87f3177af1495ca4727239e25421185a SHA1 0b421384148da1931ace84935e27f7fb03b2750a SHA256 d57b395a195d7d576c9476032529476e8d3998e213cbed601f2646499fc5a284 diff --git a/sys-kernel/linux-server/files/2.6.31/cfq-iosched-IO-latency.patch b/sys-kernel/linux-server/files/2.6.31/cfq-iosched-IO-latency.patch new file mode 100644 index 000000000..0f10f8220 --- /dev/null +++ b/sys-kernel/linux-server/files/2.6.31/cfq-iosched-IO-latency.patch @@ -0,0 +1,112 @@ +diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c +index 87276eb..57ed6fc 100644 +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -140,7 +140,7 @@ struct cfq_data { + */ + unsigned int busy_rt_queues; + +- int rq_in_driver; ++ int rq_in_driver[2]; + int sync_flight; + + /* +@@ -239,6 +239,11 @@ static struct cfq_queue *cfq_get_queue(struct cfq_data *, int, + static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *, + struct io_context *); + ++static inline int rq_in_driver(struct cfq_data *cfqd) ++{ ++ return cfqd->rq_in_driver[0] + cfqd->rq_in_driver[1]; ++} ++ + static inline struct cfq_queue *cic_to_cfqq(struct cfq_io_context *cic, + int is_sync) + { +@@ -760,9 +765,9 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; + +- cfqd->rq_in_driver++; ++ cfqd->rq_in_driver[rq_is_sync(rq)]++; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "activate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + + cfqd->last_position = blk_rq_pos(rq) + blk_rq_sectors(rq); + } +@@ -770,11 +775,12 @@ static void cfq_activate_request(struct request_queue *q, struct request *rq) + static void cfq_deactivate_request(struct request_queue *q, struct request *rq) + { + struct cfq_data *cfqd = q->elevator->elevator_data; ++ const int sync = rq_is_sync(rq); + +- WARN_ON(!cfqd->rq_in_driver); +- cfqd->rq_in_driver--; ++ WARN_ON(!cfqd->rq_in_driver[sync]); ++ cfqd->rq_in_driver[sync]--; + cfq_log_cfqq(cfqd, RQ_CFQQ(rq), "deactivate rq, drv=%d", +- cfqd->rq_in_driver); ++ rq_in_driver(cfqd)); + } + + static void cfq_remove_request(struct request *rq) +@@ -1080,7 +1086,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd) + /* + * still requests with the driver, don't idle + */ +- if (cfqd->rq_in_driver) ++ if (rq_in_driver(cfqd)) + return; + + /* +@@ -1312,6 +1318,12 @@ static int cfq_dispatch_requests(struct request_queue *q, int force) + return 0; + + /* ++ * Drain async requests before we start sync IO ++ */ ++ if (cfq_cfqq_idle_window(cfqq) && cfqd->rq_in_driver[BLK_RW_ASYNC]) ++ return 0; ++ ++ /* + * If this is an async queue and we have sync IO in flight, let it wait + */ + if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq)) +@@ -2130,11 +2142,11 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq) + */ + static void cfq_update_hw_tag(struct cfq_data *cfqd) + { +- if (cfqd->rq_in_driver > cfqd->rq_in_driver_peak) +- cfqd->rq_in_driver_peak = cfqd->rq_in_driver; ++ if (rq_in_driver(cfqd) > cfqd->rq_in_driver_peak) ++ cfqd->rq_in_driver_peak = rq_in_driver(cfqd); + + if (cfqd->rq_queued <= CFQ_HW_QUEUE_MIN && +- cfqd->rq_in_driver <= CFQ_HW_QUEUE_MIN) ++ rq_in_driver(cfqd) <= CFQ_HW_QUEUE_MIN) + return; + + if (cfqd->hw_tag_samples++ < 50) +@@ -2161,9 +2173,9 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + + cfq_update_hw_tag(cfqd); + +- WARN_ON(!cfqd->rq_in_driver); ++ WARN_ON(!cfqd->rq_in_driver[sync]); + WARN_ON(!cfqq->dispatched); +- cfqd->rq_in_driver--; ++ cfqd->rq_in_driver[sync]--; + cfqq->dispatched--; + + if (cfq_cfqq_sync(cfqq)) +@@ -2197,7 +2209,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) + cfq_arm_slice_timer(cfqd); + } + +- if (!cfqd->rq_in_driver) ++ if (!rq_in_driver(cfqd)) + cfq_schedule_dispatch(cfqd); + } + + diff --git a/sys-kernel/linux-server/linux-server-2.6.31.ebuild b/sys-kernel/linux-server/linux-server-2.6.31.ebuild index 984eebb7e..7ff1d25e7 100644 --- a/sys-kernel/linux-server/linux-server-2.6.31.ebuild +++ b/sys-kernel/linux-server/linux-server-2.6.31.ebuild @@ -36,6 +36,11 @@ KERN_INITRAMFS_SEARCH_NAME="initramfs-genkernel-${ARCH}-*-server-*" # patches UNIPATCH_LIST="${DISTFILES}/${K_SABPATCHES_PKG}" +# patches +UNIPATCH_LIST=" + ${DISTFILES}/${K_SABPATCHES_PKG} + ${FILESDIR}/${PV}/cfq-iosched-IO-latency.patch +" src_unpack() {