OK, turing.

<- leave blank

Wed Jul 17 23:05:44 EDT 2019

Лимиты создают преждевременные проблемы: процесс, упёршийся в лимиты, при их
отсутствии мог бы работать дальше практически без вреда для системы.
В случае с юзерспейсным киллером завершение процесса откладывается до того
момента, когда - это действительно необходимио - до падения уровня доступной
памяти ниже заданного.

Wed Jul 17 22:52:27 EDT 2019
Корректное завершение по SIGTERM предпочтительнее, чем неожиданное поведение при
окончании лимита памяти.

Wed Jul 17 22:39:12 EDT 2019
find_zram_disksize_factor.py

Wed Jul 17 22:33:23 EDT 2019
лимиты могут приводить к неожиданному поведению

Wed Jul 17 20:50:05 EDT 2019
if os.path.exists('/proc/' + pid + '/exe') is True:

->
if os.path.exists('/proc/' + pid + '/exe') :

Wed Jul 17 20:47:09 EDT 2019
    # wait for memory release after corrective action
    # may be useful if free memory was about 0 immediately after
    # corrective action
    sleep(0.05)
1004 line

Wed Jul 17 16:45:31 EDT 2019
#!/bin/rc
# secretz - a local replacement for secstore
rfork en
enc=$home/lib/factotum
fn usage {
	>[2=1] echo 'secretz [-c | -e | -l]'
	exit usage
}
ramfs -p
echo -n 'secret: '
</dev/cons >/dev/consctl {
	echo rawon
	read >/tmp/secret
}
echo
switch($1){
	case -c
		sam /tmp/factotum
		</tmp/factotum >$enc <[3]/tmp/secret auth/aescbc -i -e ||
		exit auth
	case -e
		<$enc >/tmp/factotum <[3]/tmp/secret auth/aescbc -i -d ||
		exit auth
		sam /tmp/factotum
		</tmp/factotum >$enc <[3]/tmp/secret auth/aescbc -i -e
		echo -n 'load?  '
		if(~ `{read} y yes)
			read -m /tmp/factotum >/mnt/factotum/ctl
	case -l *
		<$enc >/tmp/factotum <[3]/tmp/secret auth/aescbc -i -d ||
		exit auth
		read -m /tmp/factotum >/mnt/factotum/ctl
}


Wed Jul 17 16:41:55 EDT 2019
diff --git a/main.c b/main.c
index 56529c9..2902285 100644
--- a/main.c
+++ b/main.c
@@ -76,6 +76,7 @@ func(Fn *fn)
	copy(fn);
	filluse(fn);
	fold(fn);
+ printfn(fn, stderr);
	T.abi(fn);
	fillpreds(fn);
	filluse(fn);


Wed Jul 17 16:40:54 EDT 2019
export function $chk() {
@l0
	%t0 =w par
	%t1 =w par
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
@l1
	%r.3 =w phi @l0 0, @l14 %r.10
	%i.4 =w phi @l0 0, @l14 %t152
	nop
	%t7 =w load $glo1
	%t5 =w csltw %i.4, %t7
	jnz %t5, @l2, @l3
@l2
	nop
	%t15 =l load $glo3
	nop
	%t17 =l extsw %t0
	%t18 =l mul 8, %t17
	%t14 =l add %t15, %t18
	%t13 =l load %t14
	nop
	%t20 =l extsw %i.4
	%t21 =l mul 4, %t20
	%t12 =l add %t13, %t21
	%t11 =w load %t12
	%t9 =w add %r.3, %t11
	nop
	nop
	nop
	nop
	%t31 =l extsw %i.4
	%t32 =l mul 8, %t31
	%t28 =l add %t15, %t32
	%t27 =l load %t28
	nop
	%t34 =l extsw %t1
	%t35 =l mul 4, %t34
	%t26 =l add %t27, %t35
	%t25 =w load %t26
	%t23 =w add %t9, %t25
	nop
	nop
	nop
	%t38 =w add %t0, %i.4
	nop
	%t37 =w csltw %t38, %t7
	nop
	nop
	%t43 =w add %t1, %i.4
	nop
	%t42 =w csltw %t43, %t7
	%t36 =w and %t37, %t42
	jnz %t36, @l4, @l5
@l4
	nop
	nop
	nop
	nop
	%t55 =w add %t0, %i.4
	%t58 =l extsw %t55
	%t59 =l mul 8, %t58
	%t53 =l add %t15, %t59
	%t52 =l load %t53
	nop
	nop
	%t60 =w add %t1, %i.4
	%t63 =l extsw %t60
	%t64 =l mul 4, %t63
	%t51 =l add %t52, %t64
	%t50 =w load %t51
	%t48 =w add %t23, %t50
	nop
@l5
	%r.7 =w phi @l2 %t23, @l4 %t48
	nop
	nop
	%t67 =w add %t0, %i.4
	nop
	%t66 =w csltw %t67, %t7
	nop
	nop
	%t73 =w sub %t1, %i.4
	%t71 =w cslew 0, %t73
	%t65 =w and %t66, %t71
	jnz %t65, @l7, @l8
@l7
	nop
	nop
	nop
	nop
	%t84 =w add %t0, %i.4
	%t87 =l extsw %t84
	%t88 =l mul 8, %t87
	%t82 =l add %t15, %t88
	%t81 =l load %t82
	nop
	nop
	%t89 =w sub %t1, %i.4
	%t92 =l extsw %t89
	%t93 =l mul 4, %t92
	%t80 =l add %t81, %t93
	%t79 =w load %t80
	%t77 =w add %r.7, %t79
	nop
@l8
	%r.8 =w phi @l5 %r.7, @l7 %t77
	nop
	nop
	%t97 =w sub %t0, %i.4
	%t95 =w cslew 0, %t97
	nop
	nop
	%t101 =w add %t1, %i.4
	nop
	%t100 =w csltw %t101, %t7
	%t94 =w and %t95, %t100
	jnz %t94, @l10, @l11
@l10
	nop
	nop
	nop
	nop
	%t113 =w sub %t0, %i.4
	%t116 =l extsw %t113
	%t117 =l mul 8, %t116
	%t111 =l add %t15, %t117
	%t110 =l load %t111
	nop
	nop
	%t118 =w add %t1, %i.4
	%t121 =l extsw %t118
	%t122 =l mul 4, %t121
	%t109 =l add %t110, %t122
	%t108 =w load %t109
	%t106 =w add %r.8, %t108
	nop
@l11
	%r.9 =w phi @l8 %r.8, @l10 %t106
	nop
	nop
	%t126 =w sub %t0, %i.4
	%t124 =w cslew 0, %t126
	nop
	nop
	%t131 =w sub %t1, %i.4
	%t129 =w cslew 0, %t131
	%t123 =w and %t124, %t129
	jnz %t123, @l13, @l14
@l13
	nop
	nop
	nop
	nop
	%t142 =w sub %t0, %i.4
	%t145 =l extsw %t142
	%t146 =l mul 8, %t145
	%t140 =l add %t15, %t146
	%t139 =l load %t140
	nop
	nop
	%t147 =w sub %t1, %i.4
	%t150 =l extsw %t147
	%t151 =l mul 4, %t150
	%t138 =l add %t139, %t151
	%t137 =w load %t138
	%t135 =w add %r.9, %t137
	nop
@l14
	%r.10 =w phi @l11 %r.9, @l13 %t135
	nop
	%t152 =w add %i.4, 1
	nop
	jmp @l1
@l3
	nop
	retw %r.3
}
export function $go() {
@l16
	%t0 =w par
	nop
	nop
	nop
	nop
	%t3 =w load $glo1
	%t1 =w ceqw %t0, %t3
	jnz %t1, @l17, @l18
@l17
	%t5 =w load $glo2
	%t4 =w add %t5, 1
	storew %t4, $glo2
	retw 0
@l18
	nop
@l20
	%x.24 =w phi @l18 0, @l24 %t45
	nop
	%t11 =w load $glo1
	%t9 =w csltw %x.24, %t11
	jnz %t9, @l21, @l22
@l21
	nop
	nop
	argw %x.24
	argw %t0
	%t13 =w call $chk
	%t12 =w ceqw %t13, 0
	jnz %t12, @l23, @l24
@l23
	%t21 =l load $glo3
	nop
	%t23 =l extsw %x.24
	%t24 =l mul 8, %t23
	%t20 =l add %t21, %t24
	%t19 =l load %t20
	nop
	%t26 =l extsw %t0
	%t27 =l mul 4, %t26
	%t18 =l add %t19, %t27
	%t28 =w load %t18
	%t17 =w add %t28, 1
	storew %t17, %t18
	nop
	%t30 =w add %t0, 1
	argw %t30
	%t29 =w call $go
	%t37 =l load $glo3
	nop
	%t39 =l extsw %x.24
	%t40 =l mul 8, %t39
	%t36 =l add %t37, %t40
	%t35 =l load %t36
	nop
	%t42 =l extsw %t0
	%t43 =l mul 4, %t42
	%t34 =l add %t35, %t43
	%t44 =w load %t34
	%t33 =w sub %t44, 1
	storew %t33, %t34
@l24
	nop
	%t45 =w add %x.24, 1
	nop
	jmp @l20
@l22
	retw 0
}
export function $main() {
@l26
	nop
	storew 8, $glo1
	nop
	argw 8
	argw 8
	%t3 =l call $calloc
	storel %t3, $glo3
	nop
@l27
	%i.29 =w phi @l26 0, @l28 %t20
	nop
	%t10 =w load $glo1
	%t8 =w csltw %i.29, %t10
	jnz %t8, @l28, @l29
@l28
	nop
	argw %t10
	argw 4
	%t12 =l call $calloc
	%t16 =l load $glo3
	nop
	%t18 =l extsw %i.29
	%t19 =l mul 8, %t18
	%t15 =l add %t16, %t19
	storel %t12, %t15
	nop
	%t20 =w add %i.29, 1
	nop
	jmp @l27
@l29
	argw 0
	%t22 =w call $go
	%t25 =w load $glo2
	%t24 =w cnew %t25, 92
	retw %t24
}


Wed Jul 17 00:59:12 EDT 2019
https://lgtm.com/query

Wed Jul 17 00:42:38 EDT 2019
https://lgtm.com/help/lgtm/adding-projects

prev | next