Skip to content

Instantly share code, notes, and snippets.

<GZ> root@gaia [~]
# dladm show-phys -H i40e0
LINK RINGTYPE RINGS CLIENTS
i40e0 RX 0-6 <default,mcast>
i40e0 TX 0-6 <default>,i40e0
i40e0 RX 7-13 i40e0
i40e0 RX 14-20 --
i40e0 RX 21-27 --
i40e0 RX 28-34 --
i40e0 RX 35-41 --
@rzezeski
rzezeski / linux-mpstat.txt
Last active November 9, 2016 07:56
linux mpstat, you're drunk
06:44:29 PM CPU 0/s 3/s 4/s 8/s 9/s 10/s 18/s 88/s 89/s 90/s 91/s 92/s 93/s 94/s 95/s 96/s 97/s 98/s 99/s 100/s 101/s 102/s 103/s 104/s 105/s 106/s 107/s 108/s 109/s 110/s 111/s 112/s 113/s 114/s 115/s 116/s 117/s 118/s 119/s 120/s 121/s 122/s 123/s 124/s 125/s 126/s 127/s 128/s 129/s 130/s 131/s 132/s 133/s 134/s 135/s 136/s 137/s 138/s 139/s 140/s 141/s 142/s 143/s 144/s 145/s 146/s 147/s 148/s 149/s 150/s 151/s 152/s 153/s 154/s 155/s 156/s 157/s 158/s 159/s 160/s 161/s 162/s 163/s 164/s 165/s 166/s 167/s 168/s 169/s 170/s 171/s 1
@rzezeski
rzezeski / foo.c
Created January 11, 2016 00:13
spin sleep
uint64_t
sl_getnsecs()
{
struct timespec ts;
(void) clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t)ts.tv_sec * 1000000000L) + ts.tv_nsec);
}
/*
* Spin until approximately ns nanoseconds have passed. The ns value
@rzezeski
rzezeski / gist:0e71c9a697b018afbc57
Created September 11, 2015 17:05
nightly fail on OI 151a8
/code/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/cw -_gcc -O -Xa -xildoff -errtags=yes -errwarn=%all -erroff=E_EMPTY_TRANSLATION_UNIT -erroff=E_STATEMENT_NOT_REACHED -_gcc=-Wno-missing-braces -_gcc=-Wno-sign-compare -_gcc=-Wno-unknown-pragmas -_gcc=-Wno-unused-parameter -_gcc=-Wno-missing-field-initializers -_gcc=-Wno-array-bounds -_gcc=-Wno-char-subscripts -_gcc=-Wno-uninitialized -_gcc=-Wno-unused-label -xc99=%none -W0,-xglobalstatic -_gcc=-fno-inline-small-functions -_gcc=-fno-inline-functions-called-once -_gcc=-fno-ipa-cp -I /code/illumos-gate/usr/src/lib/libc/port/locale -o native/collate.o -c collate.c
+ /opt/gcc/4.4.4/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -D__sun -O -Wall -Wextra -Werror -Wno-missing-braces -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-char-subscripts -Wno-uninitialized -Wno-unused-label -std=gnu89 -fno-inline-smal
11 7086 futex:entry futex(601c40, 128, 0, _, _, _)
5 7086 futex:entry futex(601c40, 129, 1, _, _, _)
11 7086 futex:entry futex(601c40, 128, 0, _, _, _)
5 7086 futex:entry futex(601c40, 129, 1, _, _, _)
11 7086 futex:entry futex(601c40, 128, 0, _, _, _)
5 7086 futex:entry futex(601c40, 129, 1, _, _, _)
11 7086 futex:entry futex(601c40, 128, 0, _, _, _)
5 7086 futex:entry futex(601c40, 129, 1, _, _, _)
11 7086 futex:entry futex(601c40, 128, 0, _, _, _)
5 7086 futex:entry futex(601c40, 129, 1, _, _, _)
@rzezeski
rzezeski / gist:8a967f9cfdd3976869eb
Last active September 4, 2015 16:56
Mono bug-18026 stuck on CentOS 6.6 lx branded zone

Summary

The Mono VM appears to have a race/deadlock issue when using sgen GC on an lx branded zone. The condition can almost ALWAYS (only once did I see it run through to completion) be reproduced by running test bug-18026. This test stresses the thread pool, task queue, and allocation facilities of the VM -- spawning many tasks performing allocation while concurrently bouncing the thread pool size up and down.

2015-06-18T03:20:40.745096+00:00 ny4-c103-n38 unix: [ID 836849 kern.notice] #012#015panic[cpu1]/thread=ffffff00f4380c40:
2015-06-18T03:20:40.745101+00:00 ny4-c103-n38 genunix: [ID 918906 kern.notice] I/O to pool 'zones' appears to be hung.
2015-06-18T03:20:40.745105+00:00 ny4-c103-n38 unix: [ID 100000 kern.notice] #012
2015-06-18T03:20:40.745110+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380a20 zfs:vdev_deadman+10b ()
2015-06-18T03:20:40.745114+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380a70 zfs:vdev_deadman+4a ()
2015-06-18T03:20:40.745128+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380ac0 zfs:vdev_deadman+4a ()
2015-06-18T03:20:40.745133+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380af0 zfs:spa_deadman+ad ()
2015-06-18T03:20:40.745138+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380b90 genunix:cyclic_softint+f3 ()
2015-06-18T03:20:40.745142+00:00 ny4-c103-n38 genunix: [ID 655072 kern.notice] ffffff00f4380ba0 unix:
@rzezeski
rzezeski / gist:3716bb3438209f4379f0
Created June 11, 2015 19:01
mono 4.0.1 test failure (SmartOS)
for i in basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe ; do ./test_op_il_seq_point.sh $i || (./test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
Checking unintended native code changes in basic.exe without AOT
Checking unintended native code changes in basic-float.exe without AOT
Checking unintended native code changes in basic-long.exe without AOT
Checking unintended native code changes in basic-calls.exe without AOT
Checking unintended native code changes in objects.exe without AOT
Checking unintended native code changes in arrays.exe without AOT
1d0
< Method (wrapper managed-to-native) System.Threading.InternalThread:Thread_free_internal (System.Threading.InternalThread,intptr) (code length 184) [arrays.exe]
7,8d5
@rzezeski
rzezeski / gist:cc189d6bbcf0e296f602
Created May 28, 2015 00:13
TCP test (sometimes connect() fails on SmartOS, but not on OmniOS or OSX)
/*
* Verify fundamental behavior of TCP stack.
*
* Based on a potential bug found when running libMicro's close_tcp
* and pipe benchmarks on SmartOS.
*
* https://github.com/rzezeski/libMicro/blob/master/src/close_tcp.c
*
* https://github.com/rzezeski/libMicro/blob/master/src/pipe.c
*
@rzezeski
rzezeski / gist:d96a7f406e3ed31b6aae
Created May 27, 2015 17:39
[dtrace] TCP TIME_WAIT duration
#!/bin/sh
dtrace -n '
#pragma D option quiet
BEGIN {
printf("%4s %21s\tDURATION (secs)\n", "ZONE", "ADDR:PORT");
}
tcp:::state-change