Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbWJQTrx (ORCPT ); Tue, 17 Oct 2006 15:47:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751245AbWJQTrw (ORCPT ); Tue, 17 Oct 2006 15:47:52 -0400 Received: from mout1.freenet.de ([194.97.50.132]:63107 "EHLO mout1.freenet.de") by vger.kernel.org with ESMTP id S1751243AbWJQTrw (ORCPT ); Tue, 17 Oct 2006 15:47:52 -0400 Date: Tue, 17 Oct 2006 21:49:48 +0200 To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] 2.6.19-rc2-mm1 pktcdvd: bio write congestion using blk_congestion_wait() Reply-To: balagi@justmail.de From: "Thomas Maier" Cc: petero2@telia.com, akpm@osdl.org, "Jens Axboe" Content-Type: multipart/mixed; boundary=----------CZV55v7uZ8vtYvIGlQrvEl MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.00 (Win32) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5953 Lines: 109 ------------CZV55v7uZ8vtYvIGlQrvEl Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Hello, this adds a bio write queue congestion control to the pktcdvd driver with fixed on/off marks. It prevents that the driver consumes a unlimited amount of write requests. Needs this patch named: [PATCH 1/2] 2.6.19-rc2-mm1 ll_rw_blk.c: export clear_queue_congested and set_queue_congested I hope this code is ok now ;) (Maybe the surrounding spin_locks can be removed, but for atomic access to bio_write_size etc., they may be a good thing...) Signed-off-by: Thomas Maier ------------CZV55v7uZ8vtYvIGlQrvEl Content-Disposition: attachment; filename=2-wqueue-congestion-2.6.19-rc2-mm1.patch Content-Type: application/octet-stream; name=2-wqueue-congestion-2.6.19-rc2-mm1.patch Content-Transfer-Encoding: Base64 ZGlmZiAtdXJwTiBsaW51eC0yLjYuMTktcmMyLW1tMS9kcml2ZXJzL2Jsb2NrL3Br dGNkdmQuYyAyLXdxdWV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PTl9PRkYg ICA5MDAwCisKKwogc3RydWN0IHBhY2tldF9zZXR0aW5ncwogewogCV9fdTMyCQkJ c2l6ZTsJCS8qIHBhY2tldCBzaXplIGluICg1MTIgYnl0ZSkgc2VjdG9ycyAqLwpA QCAtMjcxLDYgKzI3Nyw5IEBAIHN0cnVjdCBwa3RjZHZkX2RldmljZQogCiAJc3Ry dWN0IHBhY2tldF9pb3NjaGVkICAgaW9zY2hlZDsKIAlzdHJ1Y3QgZ2VuZGlzawkJ KmRpc2s7CisKKwlpbnQJCQl3cml0ZV9jb25nZXN0aW9uX29mZjsKKwlpbnQJCQl3 cml0ZV9jb25nZXN0aW9uX29uOwogfTsKIAogI2VuZGlmIC8qIF9fS0VSTkVMX18g Ki8K ------------CZV55v7uZ8vtYvIGlQrvEl-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/