Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 18 Feb 2001 14:25:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 18 Feb 2001 14:25:37 -0500 Received: from bacchus.veritas.com ([204.177.156.37]:3236 "EHLO bacchus-int.veritas.com") by vger.kernel.org with ESMTP id ; Sun, 18 Feb 2001 14:25:18 -0500 Date: Sun, 18 Feb 2001 19:31:36 +0000 (GMT) From: Mark Hemment To: Alan Cox cc: linux-kernel@vger.kernel.org Subject: [PATCH] HIGHMEM+buffers Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="168455872-793547845-982524696=:11260" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --168455872-793547845-982524696=:11260 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, On a 4GB SMP box, configured with HIGHMEM support, making a 670G (obviously using a volume manager) ext2 file system takes 12minutes (over 10minutes of sys time). One problem is buffer allocations do not use HIGHMEM, but the nr_free_buffer_pages() doesn't take this into account causing balance_dirty_state() to return the wrong state. The attached patch fixes the worse part of nr_free_buffer_pages() - with HIGHMEM it now only counts free+inactive pages in the NORMAL and DMA zone. It doesn't fix the inactive_dirty calculation. Also, in buffer.c:flush_dirty_buffers(), it is worthwhile to kick the disk queues if it decides to reschedule. With the patch, that 670G filesystem can be created in 5m36secs (under half the time). Patch is against 2.4.1-ac18. Mark --168455872-793547845-982524696=:11260 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="buffer.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: buffer.patch Content-Disposition: attachment; filename="buffer.patch" ZGlmZiAtdXJOIC1YIGRvbnRkaWZmIHZhbmlsbGEtMi40LjEtYWMxOC9mcy9i dWZmZXIuYyBtYXJraGUtMi40LjEtYWMxOC9mcy9idW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QgaW50IG5y X2ZyZWVfYnVmZmVyX3BhZ2VzICh2b2lkKQ0KIHsNCiAJdW5zaWduZWQgaW50 IHN1bTsNCiANCi0Jc3VtID0gbnJfZnJlZV9wYWdlcygpOw0KLQlzdW0gKz0g bnJfaW5hY3RpdmVfY2xlYW5fcGFnZXMoKTsNCisjaWYJQ09ORklHX0hJR0hN RU0NCisJc3VtID0gbnJfZnJlZV9wYWdlc196b25lKFpPTkVfTk9STUFMKSAr DQorCSAgICAgIG5yX2ZyZWVfcGFnZXNfem9uZShaT05FX0RNQSkgKw0KKwkg ICAgICBucl9pbmFjdGl2ZV9jbGVhbl9wYWdlc196b25lKFpPTkVfTk9STUFM KSArDQorCSAgICAgIG5yX2luYWN0aXZlX2NsZWFuX3BhZ2VzX3pvbmUoWk9O RV9ETUEpOw0KKyNlbHNlDQorCXN1bSA9IG5yX2ZyZWVfcGFnZXMoKSArDQor CSAgICAgIG5yX2luYWN0aXZlX2NsZWFuX3BhZ2VzKCk7DQorI2VuZGlmDQog CXN1bSArPSBucl9pbmFjdGl2ZV9kaXJ0eV9wYWdlczsNCiANCiAJLyoNCg== --168455872-793547845-982524696=:11260-- - 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/