Skip to content

Instantly share code, notes, and snippets.

View 0x7f454c46's full-sized avatar

Dmitry Safonov 0x7f454c46

  • Dublin
View GitHub Profile
@0x7f454c46
0x7f454c46 / gist:9556db0403e300c58f97d2cc47745cc7
Created May 2, 2019 00:29
ia32: transition/thread-bomb mmap()s all 4Gb
[root@Mindolluin criu]# cat /proc/25929/maps
004f4000-004f5000 ---p 00000000 00:00 0
004f5000-00cf5000 rw-p 00000000 00:00 0
00cf5000-00cf6000 ---p 00000000 00:00 0
00cf6000-014f6000 rw-p 00000000 00:00 0
014f6000-014f7000 ---p 00000000 00:00 0
014f7000-01cf7000 rw-p 00000000 00:00 0
01cf7000-01cf8000 ---p 00000000 00:00 0
01cf8000-024f8000 rw-p 00000000 00:00 0
024f8000-024f9000 ---p 00000000 00:00 0
@0x7f454c46
0x7f454c46 / gtod.txt
Created June 13, 2019 22:42
Number of raw sys_gettimeofday() on zdtm.py tests - before and after using vdso in restorer
before after test
48 5 zdtm/static/cgroup02
49 5 zdtm/static/busyloop00
49 5 zdtm/static/cgroup01
49 5 zdtm/static/cgroup03
49 5 zdtm/static/cgroupns
49 5 zdtm/static/console
49 5 zdtm/static/cwd01
49 5 zdtm/static/cwd02
49 5 zdtm/static/deleted_dev
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index c1d5a751bea1..b8106a80d36c 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -39,25 +39,28 @@ u64 vdso_calc_delta(u64 cycles, u64 last, u64 mask, u32 mult)
#endif
#ifdef CONFIG_TIME_NS
-static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
- struct __kernel_timespec *ts)
TIMENS:
[root@shire timens]# ./gettime_perf
1..8
ok 1 host: clock: monotonic cycles: 73790550
ok 2 host: clock: monotonic-coarse cycles: 255413816
ok 3 host: clock: monotonic-raw cycles: 72070758
ok 4 host: clock: boottime cycles: 73816953
ok 5 ns: clock: monotonic cycles: 61728658
ok 6 ns: clock: monotonic-coarse cycles: 198742384
ok 7 ns: clock: monotonic-raw cycles: 59500941
@0x7f454c46
0x7f454c46 / gist:7d3da033540ac455963a1eb81a392174
Created January 30, 2020 19:01
parasite vdso <=> vvar intersection
diff --git a/criu/pie/parasite-vdso.c b/criu/pie/parasite-vdso.c
index 38da766804ab..733d14257217 100644
--- a/criu/pie/parasite-vdso.c
+++ b/criu/pie/parasite-vdso.c
@@ -30,7 +30,7 @@ static int remap_one(char *who, unsigned long *from, unsigned long to, size_t si
{
unsigned long addr;
- pr_debug("Remap %s %lx -> %lx\n", who, *from, to);
+ pr_debug("Remap %s %lx -> %lx [%lx]\n", who, *from, to, size);
[dima@Mindolluin linux-loglevel]$ cat lib/test_pr_cont.c
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/printk.h>
static int __init pr_cont_tests(void)
{
pr_info("pr_cont() tests:\n");
@0x7f454c46
0x7f454c46 / gist:8f68311dfa1f240959fdbe7c77ed2259
Last active September 21, 2020 14:03
xfrm-compat v2-v3 diff
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 633c210bd2dd..53618a31634b 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -2000,35 +2000,36 @@ static inline int xfrm_tunnel_check(struct sk_buff *skb, struct xfrm_state *x,
return 0;
}
+extern const int xfrm_msg_min[XFRM_NR_MSGTYPES];
extern const struct nla_policy xfrma_policy[XFRMA_MAX+1];
@0x7f454c46
0x7f454c46 / gist:c3a6234943bdb617ccbdade306f02b00
Created May 10, 2023 21:50
TCP-AO iperf3 run for clone-tfm vs tcp_sigpool (TCP-AO-v6)
[root@archlinux tmp]# echo 0 > /proc/sys/net/ipv4/tcp_percpu_pool
[root@archlinux tmp]# nice -20 ./iperf3 -s --ao-password abc123 --ao-algorithm 'hmac(sha1)' -p 12345 -A 0 2>&1 > /dev/null &
[1] 1601
[root@archlinux tmp]# [ 1795.143281] tcp_sigpool_alloc_ahash: using clone tfm for hmac(sha1) [0]
[root@archlinux tmp]# nice -20 ./iperf3 -c localhost --ao-password abc123 --ao-algorithm 'hmac(sha1)' -p 12345 -t 30 -A 1
Connecting to host localhost, port 12345
[ 5] local ::1 port 42596 connected to ::1 port 12345
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 125 MBytes 1.04 Gbits/sec 0 639 KBytes
1: a291f3b54022 = 1: 435d4f9ce486 net/tcp: Prepare tcp_md5sig_pool for TCP-AO
2: 6b2f304dfa84 = 2: af930060117e net/tcp: Add TCP-AO config and structures
3: a067d79b4f1a = 3: 000a493414ce net/tcp: Introduce TCP_AO setsockopt()s
4: 296293cbde93 = 4: beff7a212fe1 net/tcp: Prevent TCP-MD5 with TCP-AO being set
5: e24e9dfc9d4c = 5: 7e877c760a84 net/tcp: Calculate TCP-AO traffic keys
6: 8db71a6fa739 ! 6: d60355172baf net/tcp: Add TCP-AO sign to outgoing packets
@@ include/net/tcp.h: struct tcp_sock_af_ops {
#endif
};