From owner-freebsd-current@FreeBSD.ORG Wed Oct 16 04:06:04 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF79A350 for ; Wed, 16 Oct 2013 04:06:04 +0000 (UTC) (envelope-from bryanv@daemoninthecloset.org) Received: from torment.daemoninthecloset.org (torment.daemoninthecloset.org [94.242.209.234]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8832D74 for ; Wed, 16 Oct 2013 04:06:04 +0000 (UTC) Received: from sage.daemoninthecloset.org (unknown [70.114.209.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "sage.daemoninthecloset.org", Issuer "daemoninthecloset.org" (verified OK)) by torment.daemoninthecloset.org (Postfix) with ESMTPS id 5AA9F42C087F for ; Wed, 16 Oct 2013 06:05:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemoninthecloset.org X-Virus-Scanned: amavisd-new at daemoninthecloset.org Date: Tue, 15 Oct 2013 22:57:40 -0500 (CDT) From: Bryan Venteicher To: FreeBSD current mailing list Message-ID: <73612885.53105.1381895860349.JavaMail.root@daemoninthecloset.org> In-Reply-To: <56667278.53010.1381894780662.JavaMail.root@daemoninthecloset.org> Subject: amd64 minidump slowness MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_53103_1768140454.1381895860347" X-Originating-IP: [192.168.10.20] X-Mailer: Zimbra 8.0.2_GA_5569 (ZimbraWebClient - GC29 ([unknown])/8.0.2_GA_5569) Thread-Topic: amd64 minidump slowness Thread-Index: krxmb8oT1gz/OMKPcM9pIMjd6o6Utw== X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 04:06:04 -0000 ------=_Part_53103_1768140454.1381895860347 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, At $JOB, we have machines with 400GB RAM that even the smallest 15GB amd64 minidump takes well over an hour. The major cause of the slowness is that in minidumpsys(), blk_write() is called PAGE_SIZE at a time. This causes blk_write() to poll the console for the Ctrl-C abort once per page. The attached patch changes blk_write() to be called with a run of physically contiguous pages. This reduced the dump time by over a magnitude. Of course, blk_write() could also be changed to poll the console less frequently (like only on every IO). If anybody else dumps on machines with lots of RAM, it would be nice to know the difference this patch makes. I've got a second set of patches that further reduces the dump time by over half that I'll try to clean up soon. http://people.freebsd.org/~bryanv/patches/minidump.patch ------=_Part_53103_1768140454.1381895860347 Content-Type: text/x-patch; name=minidump.patch Content-Disposition: attachment; filename=minidump.patch Content-Transfer-Encoding: base64 Y29tbWl0IDI1ZjllODJlNGFjOTNlNzFjNmNmMDZmZTJmYWExODk5OTY3ZGI3MjUKQXV0aG9yOiBC cnlhbiBWZW50ZWljaGVyIDxicnlhbnZlbnRlaWNoZXJAZ21haWwuY29tPgpEYXRlOiAgIFN1biBT ZXAgMjkgMTM6NTY6NDIgMjAxMyAtMDUwMAoKICAgIENhbGwgYmxrX3dyaXRlKCkgd2l0aCBhIHJ1 biBvZiBwaHlzaWNhbGx5IGNvbnRpZ3VvdXMgcGFnZXMKICAgIAogICAgUHJldmlvdXNseSwgYmxr X3dyaXRlKCkgd2FzIGJlaW5nIGNhbGxlZCBvbmUgcGFnZSBhdCBhIHRpbWUsIHdoaWNoCiAgICB3 b3VsZCBjYXVzZSBpdCB0byBwb2xsIHRoZSBjb25zb2xlIGZvciBldmVyeSBwYWdlLiBUaGlzIGNo YW5nZSBtYWtlcwogICAgZHVtcGluZyBhIG1hZ25pdHVkZSBmYXN0ZXIsIGFuZCBpcyBlc3BlY2lh bGx5IHVzZWZ1bCBvbiBsYXJnZSBtZW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aXRzID0gdm1fcGFnZV9kdW1wW2ldOwogCQl3aGlsZSAoYml0 cykgewogCQkJYml0ID0gYnNmcShiaXRzKTsKIAkJCXBhID0gKCgodWludDY0X3QpaSAqIHNpemVv Zigqdm1fcGFnZV9kdW1wKSAqIE5CQlkpICsgYml0KSAqIFBBR0VfU0laRTsKLQkJCWVycm9yID0g YmxrX3dyaXRlKGRpLCAwLCBwYSwgUEFHRV9TSVpFKTsKLQkJCWlmIChlcnJvcikKLQkJCQlnb3Rv IGZhaWw7CisJCQlpZiAoc3ogPT0gMCB8fCBzdGFydF9wYSArIHN6ID09IHBhKSB7CisJCQkJaWYg KHN6ID09IDApCisJCQkJCXN0YXJ0X3BhID0gcGE7CisJCQkJc3ogKz0gUEFHRV9TSVpFOworCQkJ fSBlbHNlIHsKKwkJCQllcnJvciA9IGJsa193cml0ZShkaSwgMCwgc3RhcnRfcGEsIHN6KTsKKwkJ CQlpZiAoZXJyb3IpCisJCQkJCWdvdG8gZmFpbDsKKwkJCQlzdGFydF9wYSA9IHBhOworCQkJCXN6 ID0gUEFHRV9TSVpFOworCQkJfQogCQkJYml0cyAmPSB+KDF1bCA8PCBiaXQpOwogCQl9CiAJfQor CWVycm9yID0gYmxrX3dyaXRlKGRpLCAwLCBzdGFydF9wYSwgc3opOworCWlmIChlcnJvcikKKwkJ Z290byBmYWlsOwogCiAJZXJyb3IgPSBibGtfZmx1c2goZGkpOwogCWlmIChlcnJvcikK ------=_Part_53103_1768140454.1381895860347--