Skip to content

Instantly share code, notes, and snippets.

View mattmacy's full-sized avatar

Matthew Macy mattmacy

View GitHub Profile

FreeBSD on Power9 (ppc64) Parity

  • NMI semantics: NMIs need to be emulated by only soft disabling interrupts, disabling interrupts blocks all interrupts except machine check exceptions and system resets.

  • Superpage support is stable and on by default in the POWER9BSD staging branch

  • NUMA support: Parse OFW and set up appropriate structures for memory to be allocated from the correct domain and interrupts to be bound to the

Assertion tsAssertion owAssertion owner->td_procner->td_proc->p_magic ==ner->td_proc->p_magic ==->p_magic == P_MAGIC fai P_MAGIC failed at /usr/ P_MAGIC failed at /usr/home/mmacy/dhome/mmacy/dled at /usr/evel/freebsdhome/mmacy/d-power/sys/kevel/freebsdern/evel/freebsd-power/sys/kstopping inlern/subr_turine 148
-power/synstile.c:724stopping inlstopping inline 107
ine 124
fatal kernel trap:
exception = 0x300 (data storage interrupt)
virtual address = 0x170d100203dc
dsisr = 0x40000000
srr0 = 0xc000000002bb
New packages to be INSTALLED:
TrueOS-clang-debug: 13.0.20181219031248
Number of packages to be installed: 1
The process will require 259 MiB more space.
[1/1] Installing TrueOS-clang-debug-13.0.20181219031248...
[1/1] Extracting TrueOS-clang-debug-13.0.20181219031248: 100%
pkg -r /mnt install -yf TrueOS-clibs
Updating install-repo repository catalogue...
install-repo repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
TrueOS-rescue: 13.0.20181220185818
Number of packages to be installed: 1
/*
* CDDL HEADER START
*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
@mattmacy
mattmacy / bootstrapping-rust-freebsd-aarch64.md
Created November 24, 2018 04:42 — forked from dumbbell/bootstrapping-rust-freebsd-aarch64.md
Bootstrapping Rust and Cargo on FreeBSD/aarch64

Bootstrapping Rust and Cargo on FreeBSD/aarch64

At the time of this writing, Rust and Cargo are available on FreeBSD/amd64 and FreeBSD/i386 only, whether it is from rustup or from the FreeBSD ports tree. Here is how I could bootstrap Rust and Cargo for FreeBSD/aarch64 from FreeBSD/amd64.

Base system for the target

To be able to cross-compile anything, you need a userland for the target.

From a release

Scaling:
FreeBSD 12 saw the introduction of a number of performance improvements:
- the introduction of the new synchronization primitive epoch to replace the
use of reader locks for providing existence guarantees for data structures
- epoch was used to provide an 85+% reduction in the overhead of pcb lookup
in high core count systems
- It was used to provide an 85+% reduction in UDP send overhead on high core
count systems see the link for a bit more detail:
http://scalebsd.org/blog/2018/06/16/UDP-and-epoch-for-liveness-guarantees
@mattmacy
mattmacy / bt.txt
Created August 18, 2018 01:15
Threads not in cv_wait
Thread 614 (LWP 102944 of process 80572):
#0 _umtx_op_err () at /usr/home/mmacy/devel/networking/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
#1 0x0000000800687571 in __thr_rwlock_rdlock (rwlock=0x800ddc000, flags=<optimized out>, tsp=<optimized out>) at /usr/home/mmacy/devel/networking/lib/libthr/thread/thr_umtx.c:307
#2 0x000000080068b449 in rwlock_rdlock_common (rwlock=<optimized out>, abstime=0x0) at /usr/home/mmacy/devel/networking/lib/libthr/thread/thr_rwlock.c:206
#3 0x0000000000212395 in ztest_spa_prop_get_set (zd=0x800dce700, id=22) at /usr/home/mmacy/devel/networking/cddl/contrib/opensolaris/cmd/ztest/ztest.c:5469
#4 0x000000000022571e in ztest_execute (test=13, zi=0x2271e0 <ztest_info+416>, id=22) at /usr/home/mmacy/devel/networking/cddl/contrib/opensolaris/cmd/ztest/ztest.c:6539
#5 0x0000000000224ff9 in ztest_thread (arg=0x16) at /usr/home/mmacy/devel/networking/cddl/contrib/opensolaris/cmd/ztest/ztest.c:6586
#6 0x0000000800685426 in thread_start (curthread=0x80dfed400) at /usr/home/mmacy/
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index f20593ed890..e7bb53ddcc4 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -149,19 +149,19 @@ static void iru_init(if_rxd_update_t iru, iflib_rxq_t rxq, uint8_t flid);
typedef struct iflib_filter_info {
driver_filter_t *ifi_filter;
- void *ifi_filter_arg;
+ void *ifi_filter_arg;
mmacy@VogonPoetry [~/devel/freebsd|0:04|17] git diff
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c
index 14d7714b8db..a22a89bb5a8 100644
--- a/usr.sbin/makefs/ffs.c
+++ b/usr.sbin/makefs/ffs.c
@@ -115,16 +115,14 @@ __FBSDID("$FreeBSD$");
/*
* Various file system defaults (cribbed from newfs(8)).
*/
-#define DFL_FRAGSIZE 1024 /* fragment size */