Test Run with Alternative pmap Implementation
Ulrich Grey
usenet at ulrich-grey.de
Mon Nov 24 12:28:13 UTC 2014
Hello,
as a starting point I have build an image (crochet, wandboard-quad) with
the source tree from here (751adfd(master)):
https://github.com/strejda/freebsd
Then I build the kernel with new pmap and rebuild the whole systen.
The system I used for the test run is entirely build on the
wandboard-quad.
The kernel is build with debugging enabled:
# Debugging support. Always need this:
options KDB # Enable kernel debugger support.
# For minimum debugger support use KDB_TRACE, for interactive use DDB.
options KDB_TRACE # Print a stack trace for a panic.
options DDB # Support DDB.
# For full debugger support use this instead:
#options GDB # Support remote GDB.
# Other debugging options...
makeoptions DEBUG=-g # Build kernel with gdb(1)
debug symbols options ALT_BREAK_TO_DEBUGGER
# Use <CR><tilde><ctrl-b> to enter debugger.
#options DEBUG
#options DEADLKRES # Enable the deadlock resolver
options INVARIANTS # Enable calls of extra sanity
checking
options INVARIANT_SUPPORT # Extra sanity checks
of internal structures, required by INVARIANTS
options DIAGNOSTIC
#options WITNESS # Enable checks to detect
#deadlocks and cycles
#
I have added These options:
makeoptions WITHOUT_MODULES="ispfw" # !!
wihout this I get a compile error, if I build the kernel on the
wandboard-quad. If I compile an image with crochet, there are no
problems.
#
options ARM_NEW_PMAP # new pmap
options NKPT2PG=64 # minimum =21 on my device
#
Then I had to change two files (advice from Svatopluk
Kraus):
#
sys/arm/include/vm.h
change following line:
#define VM_MEMATTR_UNCACHEABLE VM_MEMATTR_NOCACHE
to
#define VM_MEMATTR_UNCACHEABLE VM_MEMATTR_SO
#
sys/arm/arm/pmap-v6-new.c
put the following three lines in
pmap_pinit() under comment:
2111 vm_page_t m;
2127 m = PHYS_TO_VM_PAGE(vtophys(pmap->pm_pt2tab));
2128 m->pindex = pte1_index((vm_offset_t)PT2MAP);
These changes are the result of some testruns.
#
As a test I did:
#
root at quad:/usr/src # make -j20 buildworld
--- buildworld ---
--- buildworld_prologue ---
--------------------------------------------------------------
>>> World build started on Sun Nov 23 20:30:52 UTC 2014
--------------------------------------------------------------
#
--- buildworld_epilogue ---
--------------------------------------------------------------
>>> World build completed on Mon Nov 24 05:10:11 UTC 2014
--------------------------------------------------------------
#
root at quad:/usr/home/gwgpi # sysctl vm.pmap.
vm.pmap.pv_entry_max: 1744848
vm.pmap.shpgperproc: 200
vm.pmap.nkpt2pg: 64
vm.pmap.sp_enabled: 1
vm.pmap.pte1.demotions: 5662
vm.pmap.pte1.mappings: 106
vm.pmap.pte1.p_failures: 193942
vm.pmap.pte1.promotions: 71377
vm.pmap.pv_entry_count: 15222
vm.pmap.pc_chunk_count: 62
vm.pmap.pc_chunk_allocs: 3013814
vm.pmap.pc_chunk_frees: 3013752
vm.pmap.pc_chunk_tryfail: 0
vm.pmap.pv_entry_frees: 943580587
vm.pmap.pv_entry_allocs: 943595809
vm.pmap.pv_entry_spare: 5610
root at quad:/usr/home/gwgpi #
#
root at quad:/usr/home/gwgpi # uname -a
FreeBSD quad 11.0-CURRENT FreeBSD 11.0-CURRENT #0 751adfd
(master)-dirty: Sun Nov 23 02:42:02 UTC 2014
root at quad:/usr/local/DEVEL/obj/usr/local/DEVEL/STREJDA/freebsd/sys/WANDBOARD-QUAD
arm
#
Here are some load averages from top -P I watched during compilation:
22.03 19,60 16,44
20,49 20,58 20,18
23,51 21,80 20,78
hw.imx6.temperature shows 46.9 C
The board has a cooling fin but no case.
regards
Ulrich
-----------------------------------------
On Fri, 21 Nov 2014 11:59:41 +0100
Ulrich Grey <usenet at ulrich-grey.de> wrote:
> Now it works!
>
> I have cloned the source tree from here:
>
> https://github.com/strejda/freebsd
>
> With crochet I have compiled an Image for Wandboard-Quad.
> This Image started without problems.
> To use the new pmap I had to add:
>
> options ARM_NEW_PMAP
>
> to the file src/sys/arm/conf/IMX6
> and to recompile the kernel.
>
> This kernel was not bootable, it crashes immediately.
> I had to add
>
> options NKPT2PG=64 (advice from Svatopluk Kraus)*
>
> to the kernel config file and recompile.
> This time the kernel booted without problems.
>
> root at quad:/usr/src # uname -a
> FreeBSD quad 11.0-CURRENT FreeBSD 11.0-CURRENT #2 751adfd
> (master)-dirty: Thu Nov 20 23:41:14 UTC 2014
> gwgpi at quad:/usr/local/DEVEL/obj/usr/local/DEVEL/STREJDA/freebsd/sys/WANDBOARD-QUAD
> arm
>
> root at quad:/usr/src # sysctl vm.pmap.
> vm.pmap.pv_entry_max: 1744848
> vm.pmap.shpgperproc: 200
> vm.pmap.nkpt2pg: 64
> vm.pmap.sp_enabled: 1
> vm.pmap.pte1.demotions: 146
> vm.pmap.pte1.mappings: 0
> vm.pmap.pte1.p_failures: 8089
> vm.pmap.pte1.promotions: 2815
> vm.pmap.pv_entry_count: 65363
> vm.pmap.pc_chunk_count: 247
> vm.pmap.pc_chunk_allocs: 177924
> vm.pmap.pc_chunk_frees: 177677
> vm.pmap.pc_chunk_tryfail: 0
> vm.pmap.pv_entry_frees: 54109068
> vm.pmap.pv_entry_allocs: 54174439
> vm.pmap.pv_entry_spare: 17620
>
> In /usr/src I did:
>
> make -j10 buildworld
>
> and it accomplished without crash.
>
> Thank you to all for the advice
> Ulrich
> ---
> * You can experiment with the number. Explanation can be
> found in sys/arm/include/pmap-v6.h (advice from Svatopluk Kraus).
> ------------------------------------------------------------------
> On Thu, 20 Nov 2014 17:06:16 +0100
> Svatopluk Kraus <onwahe at gmail.com> wrote:
>
> > Are you running the kernel with our pmap? If you type "sysctl
> > vm.pmap", you should get something like this:
> >
> > root at pandaboard:~ # sysctl vm.pmap
> > vm.pmap.pv_entry_max: 1488480
> > vm.pmap.shpgperproc: 200
> > vm.pmap.nkpt2pg: 10
> > vm.pmap.sp_enabled: 1
> > vm.pmap.pte1.demotions: 0
> > vm.pmap.pte1.mappings: 0
> > vm.pmap.pte1.p_failures: 44
> > vm.pmap.pte1.promotions: 9
> > vm.pmap.pv_entry_count: 11082
> > vm.pmap.pc_chunk_count: 42
> > vm.pmap.pc_chunk_allocs: 2882
> > vm.pmap.pc_chunk_frees: 2840
> > vm.pmap.pc_chunk_tryfail: 0
> > vm.pmap.pv_entry_frees: 534924
> > vm.pmap.pv_entry_allocs: 546006
> > vm.pmap.pv_entry_spare: 3030
> >
> >
> > Svatopluk Kraus
> >
> >
> >
> > On Thu, Nov 20, 2014 at 3:19 PM, Ulrich Grey <usenet at ulrich-grey.de>
> > wrote:
> >
> > > Hello,
> > >
> > > here the second try:
> > >
> > > I added this two lines in src/sys/arm/conf/IMX6
> > >
> > > makeoptions WITHOUT_MODULES="ispfw"
> > > without this I got a compile error in the past.
> > >
> > > options ARM_NEW_PMAP
> > >
> > > I have build the kernel without problems and rebooted.
> > > Superpages are enabled.
> > >
> > > This is the running kernel:
> > >
> > > root at quad:~ # uname -a
> > > FreeBSD quad 11.0-CURRENT FreeBSD 11.0-CURRENT #0 751adfd
> > > (master)-dirty: Wed Nov 19 17:15:31 UTC 2014
> > > gwgpi at quad
> > > :/usr/local/DEVEL/obj/usr/local/DEVEL/STREJDA/freebsd/sys/WANDBOARD-QUAD
> > > arm
> > >
> > > The userland is on revision: r274634M
> > >
> > > Then I went to /usr/src and build your source tree:
> > >
> > > make -j10 buildworld
> > >
> > > After some hours the compilation stopped, but no crash occurs (an
> > > endless loop?):
> > >
> > > cc -fpic -DPIC -O -pipe
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/lib <A5><A5>c/arm -DNLS
> > > -D__DBINTERFACE_PRIVATE
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/gdtoa
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/libc-vis
> > > -DINET6 -I/
> > > <A5><A5>usr/obj/usr/local/DEVEL/STREJDA/freebsd/lib/libc
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/resolv -D_ACL_PRIVATE
> > > -DPOSIX_MISTAKE -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../li
> > > <A5><A5>bmd
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/jemalloc/include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/tzcode/stdtime
> > > -I/usr/local/DEVEL/STREJDA/f <A5><A5>reebsd/lib/libc/stdtime
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/locale -DBROKEN_DES
> > > -DPORTMAP -DDES_BUILTIN
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/rpc
> > > -I/usr/local/DEVEL/
> > > <A5><A5>STREJDA/freebsd/lib/libc/arm/softfloat
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/softfloat
> > > -DSOFTFLOAT_FOR_GCC -DYP -DNS_CACHING -DSYMBOL_VERSIONING
> > > -std=gnu99 -Wsystem-headers <A5><A5>-Werror -Wall -Wno-format-y2k
> > > -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body
> > > -Wno-string-plus-int -Wno-unused-const-variable
> > > -Wno-tautological-compare -Wno-unused-value -Wno-
> > > <A5><A5>parentheses-equality -Wno-unused-function
> > > -Wno-enum-conversion -Wno-switch -Wno-switch-enum
> > > -Wno-knr-promoted-parameter -Qunused-arguments -c nslexer.c -o
> > > nslexer.So
> > > --- libc.so.7 ---
> > > --- libc_pic.a ---
> > > building shared library libc.so.7
> > > building special pic c library
> > > ranlib -D libc_pic.a
> > >
> > > I waited some hours, but nothing happened anymore.
> > >
> > > root at quad:~ # ps auxww
> > > USER PID %CPU %MEM VSZ RSS TT STAT STARTED
> > > TIME COMMAND
> > >
> > > root 10 295.9 0.5 0 10488 - RL 1:16AM
> > > 1121:36.09 [idle]
> > >
> > > root 92318 100.0 1.3 35396 27460 0 R 3:34AM
> > > 344:30.76 cc -O -pipe
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/arm -DNLS
> > > -D__DBINTERFACE_PRIVATE
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/gdtoa
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/libc-vis
> > > -DINET6 -I/usr/obj/usr/local/DEVEL/STREJDA/freebsd/lib/libc
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/resolv -D_ACL_PRIVATE
> > > -DPOSIX_MISTAKE
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../libmd
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/jemalloc/include
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/../../contrib/tzcode/stdtime
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/stdtime
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/locale -DBROKEN_DES
> > > -DPORTMAP -DDES_BUILTIN
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/rpc
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/arm/softfloat
> > > -I/usr/local/DEVEL/STREJDA/freebsd/lib/libc/softfloat
> > > -DSOFTFLOAT_FOR_GCC -DYP -DNS_CACHING -DSYMBOL_VERSIONING
> > > -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k
> > > -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body
> > > -Wno-string-plus-int -Wno-unused-const-variable
> > > -Wno-tautological-compare -Wno-unused-value
> > > -Wno-parentheses-equality -Wno-unused-function
> > > -Wno-enum-conversion -Wno-switch -Wno-switch-enum
> > > -Wno-knr-promoted-parameter -Qunused-arguments -c munlock.S
> > >
> > > root 16 0.2 0.5 0 10464 - DL 1:16AM
> > > 1:54.06 [syncer]
> > >
> > > root 97452 0.2 0.1 11580 2996 1 S+ 9:14AM
> > > 0:01.34 top -P
> > >
> > > root 0 0.0 0.5 0 10488 - DLs 1:16AM
> > > 0:00.19 [kernel]
> > >
> > > root 1 0.0 0.0 9296 884 - ILs 1:16AM
> > > 0:00.05 /sbin/init --
> > >
> > > root 2 0.0 0.5 0 10472 - DL 1:16AM
> > > 7:43.52 [cam]
> > >
> > > root 3 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:00.00 [sctp_iterator]
> > >
> > > root 4 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:00.21 [mmcsd0: mmc/sd card]
> > >
> > > root 5 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:00.26 [mmcsd1: mmc/sd card]
> > >
> > > root 6 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:12.04 [pagedaemon]
> > >
> > > root 7 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:00.00 [vmdaemon]
> > >
> > > root 8 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:00.00 [pagezero]
> > >
> > > root 9 0.0 0.5 0 10472 - DL 1:16AM
> > > 0:01.06 [bufdaemon]
> > >
> > > root 11 0.0 0.5 0 10576 - WL 1:16AM
> > > 50:52.07 [intr]
> > >
> > > root 12 0.0 0.5 0 10480 - DL 1:16AM
> > > 5:42.76 [geom]
> > >
> > > root 13 0.0 0.5 0 10464 - DL 1:16AM
> > > 2:14.70 [rand_harvestq]
> > >
> > > root 14 0.0 0.5 0 10520 - DL 1:16AM
> > > 54:25.17 [usb]
> > >
> > > root 15 0.0 0.5 0 10464 - DL 1:16AM
> > > 0:03.81 [vnlru]
> > >
> > > root 262 0.0 0.1 8896 1048 - Ss 1:17AM
> > > 0:00.05 /sbin/devd
> > >
> > > root 347 0.0 0.1 10224 1528 - Ss 1:17AM
> > > 0:00.18 /usr/sbin/syslogd -ss
> > >
> > > root 440 0.0 0.1 10468 1216 - Is 1:17AM
> > > 0:00.01 casperd: zygote (casperd)
> > >
> > > root 441 0.0 0.1 10468 1292 - Is 1:17AM
> > > 0:00.02 /sbin/casperd
> > >
> > > messagebus 475 0.0 0.1 10780 1552 - Is 1:17AM
> > > 0:00.01 /usr/local/bin/dbus-daemon --system
> > >
> > > root 511 0.0 0.1 12712 2604 - Ss 1:17AM
> > > 0:02.21 /usr/sbin/ntpd -g -c /etc/ntp.conf -p /var/run/ntpd.pid
> > > -f /var/db/ntpd.drift
> > >
> > > root 541 0.0 0.1 15836 3012 - Is 1:17AM
> > > 0:00.02 /usr/sbin/sshd
> > >
> > > root 545 0.0 0.1 10300 1784 - Ss 1:17AM
> > > 0:00.43 /usr/sbin/cron -s
> > >
> > > root 601 0.0 0.3 18904 6452 - Is 1:19AM
> > > 0:00.13 sshd: gwgpi [priv] (sshd)
> > >
> > > gwgpi 604 0.0 0.2 18904 4032 - I 1:19AM
> > > 2:23.04 sshd: gwgpi at pts/0 (sshd)
> > >
> > > root 878 0.0 0.3 18904 6540 <3%2018904%20%206540> -
> > > Is 1:20AM 0:00.18
> > > sshd: gwgpi [priv] (sshd)
> > >
> > > gwgpi 896 0.0 0.2 18904 4032 - S 1:20AM
> > > 0:01.03 sshd: gwgpi at pts/1 (sshd)
> > >
> > > root 590 0.0 0.1 11208 2864 u0 Is 1:17AM
> > > 0:00.10 login [pam] (login)
> > >
> > > root 591 0.0 0.2 11208 4472 u0 S 1:17AM
> > > 0:00.21 -csh (csh)
> > >
> > > root 97457 0.0 0.1 10448 2084 u0 R+ 9:21AM
> > > 0:00.01 ps auxww
> > >
> > > gwgpi 605 0.0 0.2 11208 3768 0 Is 1:19AM
> > > 0:00.07 -csh (csh)
> > >
> > > root 607 0.0 0.1 11200 2708 0 I 1:19AM
> > > 0:00.08 su
> > >
> > > root 608 0.0 0.2 11208 3764 0 I 1:19AM
> > > 0:00.08 _su (csh)
> > >
> > > root 613 0.0 0.1 8944 1120 0 S+ 1:20AM
> > > 0:03.32 make -j10 buildworld
> > >
> > > root 618 0.0 0.1 10740 2288 0 I 1:20AM
> > > 0:00.01 sh -ev
> > >
> > > root 619 0.0 0.1 8944 1648 0 S 1:20AM
> > > 0:02.76 make -m /usr/local/DEVEL/STREJDA/freebsd/share/mk -f
> > > Makefile.inc1 TARGET=arm TARGET_ARCH=armv6 buildworld
> > >
> > > root 83869 0.0 0.1 10740 2340 0 I 3:23AM
> > > 0:00.02 sh -ev
> > >
> > > root 83870 0.0 0.1 8944 1724 0 S 3:23AM
> > > 0:00.94 make -f Makefile.inc1
> > > DESTDIR=/usr/obj/usr/local/DEVEL/STREJDA/freebsd/tmp -DNO_FSCHG
> > > MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no MK_PROFILE=no
> > > MK_TESTS=no MK_TESTS_SUPPORT=yes libraries
> > >
> > > root 83883 0.0 0.1 10740 2288 0 I 3:23AM
> > > 0:00.01 sh -ev
> > >
> > > root 84734 0.0 0.1 8944 1724 0 S 3:24AM
> > > 0:01.01 make -f Makefile.inc1 _startup_libs
> > >
> > > root 84750 0.0 0.1 10740 2340 0 I 3:24AM
> > > 0:00.04 sh -ev
> > >
> > > root 86840 0.0 1.2 29424 24084 0 S 3:28AM
> > > 0:15.96 make MK_TESTS=no DIRPRFX=lib/libc/ all
> > >
> > > root 92313 0.0 0.1 10740 2284 0 I 3:34AM
> > > 0:00.09 sh -ev
> > >
> > > gwgpi 897 0.0 0.2 11208 3768 1 Is 1:20AM
> > > 0:00.08 -csh (csh)
> > >
> > > root 906 0.0 0.1 11200 2708 1 I 1:20AM
> > > 0:00.11 su
> > >
> > > root 945 0.0 0.2 11208 3764 1 I 1:20AM
> > > 0:00.21 _su (csh)
> > >
> > > root at quad:~ # sysctl vm.pmap.
> > > vm.pmap.sp_enabled: 1
> > > vm.pmap.pv_entry_count: 5691
> > > vm.pmap.pv_entry_max: 1744848
> > > vm.pmap.shpgperproc: 200
> > > vm.pmap.section.demotions: 3
> > > vm.pmap.section.mappings: 0
> > > vm.pmap.section.p_failures: 35
> > > vm.pmap.section.promotions: 8
> > >
> > > --
> > > regards
> > > Ulrich
> > > ----------------------------------
> > > On Thu, 20 Nov 2014 00:04:38 +0100
> > > Svatopluk Kraus <onwahe at gmail.com> wrote:
> > >
> > > > On Wed, Nov 19, 2014 at 10:59 PM, Ulrich Grey
> > > > <usenet at ulrich-grey.de> wrote:
> > > >
> > > > > Thank you for the offer, I have tried it.
> > > > >
> > > > > After I had cloned your repository I have added 2 lines to
> > > > > src/sys/arm/conf/IMX6:
> > > > >
> > > > > makeoptions WITHOUT_MODULES="ispfw" # compile error
> > > > > makeoptions ARM_NEW_PMAP="yes" # is that ok ?
> > > > >
> > > > >
> > > > Add this line to sys/arm/conf/IMX6 file:
> > > >
> > > > options ARM_NEW_PMAP
> > > >
> > > > Svatopluk Kraus
> > >
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
More information about the freebsd-arm
mailing list