Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2013 16:17:19 -0600
From:      Zbigniew Bodek <zbb@semihalf.com>
To:        <freebsd-arm@freebsd.org>
Cc:        Aleksandr Rybalko <ray@freebsd.org>, Alan Cox <alc@cs.rice.edu>
Subject:   =?UTF-8?Q?pmap=5Fcopy=20for=20ARMv=36/v=37?=
Message-ID:  <eb88997fc774ddc47ca0b44e3ef2dbd8@smtp.semihalf.com>

next in thread | raw e-mail | index | archive | help
--=_19aa6322d7875fcf9bb1e310a4996ca6
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"

Hello Everyone,

I would like to share with you the patch adding pmap_copy()
functionality to pmap-v6.c. This is the last but not least of
the pmap improvements done as a part of Semihalf work on
Superpages support.

We tried various technics to test the patch on our target.
Apart from obvious long term stability tests and others,
we used a simple benchmark to measure fork system call time and overhead.

The program can be downloaded from here:
http://berlin.ccc.de/~packet/fork_test.c

A single fork time has increased as suspected (the program is not measuring
a real-life fork situation where child process is actually doing something)
but the average system overhead has decreased.
For 10000 fork(), 10000 vfork() and 10000 pthread_create() calls we observe
100000 less vm_faults and shorter overall test time.

If you have any suggestions or have an idea for benchmarking this
feature please share.

We will appreciate if you could test this patch on your ARM platforms and
send
us your review/feedback.

Best regards
Zbyszek Bodek
--=_19aa6322d7875fcf9bb1e310a4996ca6
Content-Transfer-Encoding: base64
Content-Type: text/x-patch; charset="UTF-8";
 name="0006-arm-Implement-pmap_copy-for-ARMv6-v7.patch"; 
Content-Disposition: attachment;
 filename="0006-arm-Implement-pmap_copy-for-ARMv6-v7.patch"; 

RnJvbSAyZjI3NWRmYWExYzk5NmZmOGY1NmU2ZGVkMzBhMmUzNzBhZTZmZDk2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBaYmlnbmlldyBCb2RlayA8emJiQHNlbWloYWxmLmNvbT4KRGF0
ZTogVGh1LCAyMyBNYXkgMjAxMyAxMjo0MDo1NyArMDIwMApTdWJqZW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worCQkJCQkvKgorCQkJCQkg
KiBJZiB0aGUgbDJfYnVja2V0IHdhcyBhY3F1aXJlZCBhcworCQkJCQkgKiBhIHJlc3VsdCBvZiBh
bGxvY2F0aW9uIHRoZW4gZnJlZSBpdC4KKwkJCQkJICovCisJCQkJCWlmIChsMmJfYWxsb2MpCisJ
CQkJCQlwbWFwX2ZyZWVfbDJfYnVja2V0KGRzdF9wbWFwLAorCQkJCQkJICAgIGwyYl9kc3QsIDEp
OworCQkJCQlnb3RvIG91dDsKKwkJCQl9CisJCQl9CisJCQlhZGRyICs9IFBBR0VfU0laRTsKKwkJ
CXNyY19wdGVwKys7CisJCX0KKwl9CitvdXQ6CisJcndfd3VubG9jaygmcHZoX2dsb2JhbF9sb2Nr
KTsKKwlQTUFQX1VOTE9DSyhzcmNfcG1hcCk7CisJUE1BUF9VTkxPQ0soZHN0X3BtYXApOwogfQog
CiAKLS0gCjEuOC4yCgo=
--=_19aa6322d7875fcf9bb1e310a4996ca6--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?eb88997fc774ddc47ca0b44e3ef2dbd8>