[08:52] <lesshaste> hi.. is there any way to enable an OOM killer on ubuntu?
[08:52] <lesshaste> It is very annoying to have to turn the PC off at the wall
[08:53] <hyperair> it's enabled by default afaik
[08:53] <lesshaste> hyperair, it really doesn't seem to be in practice
[08:54] <hyperair> you probably have too much swap
[08:54] <hyperair> it hangs, right?
[08:54] <lesshaste> hyperair, ah.. 
[08:54] <hyperair> basically it needs time to fill up the swap, and thrash about for a bit
[08:54] <lesshaste> it is thrashing exactly
[08:54] <hyperair> only when it can't allocate more memory does it trigger OOM
[08:54] <hyperair> as long as there's more swap, it can allocate more memory
[08:54] <hyperair> and thrash some more
[08:54] <lesshaste> oh.. I want it to kill the process when it is thrashing which I see is a different problem
[08:54] <hyperair> yeah that's a different problem
[08:54] <lesshaste> because the thrashing is unkillable in effect
[08:54] <hyperair> i think you can play with overcommit ratio or something
[08:55] <hyperair> well
[08:55] <lesshaste> as I can't even get to a terminal to type "kill"
[08:55] <hyperair> depending on the size of your swap, you can actually just wait it out
[08:55] <hyperair> i've let a thrashing machine sit for 30 minutes, and it fixed itself
[08:55] <lesshaste> hyperair,  I think that's potentially forever
[08:55] <hyperair> most of the time i don't have the patience and cut the power though
[08:55] <hyperair> or start hammering the sysrq keys
[08:55] <hyperair> ah
[08:55] <lesshaste> hyperair, if I have a process which takes 1 hour normally and starts thrashing
[08:55] <hyperair> AH
[08:55] <hyperair> yes
[08:55] <lesshaste> I could be waiting for years
[08:55] <hyperair> there's a sysrq key that triggers the OOM killer
[08:55] <lesshaste> oh!
[08:56] <hyperair> https://en.wikipedia.org/wiki/Magic_SysRq_key
[08:56] <hyperair> alt+sysrq+f
[08:56] <hyperair> you need to enable it though
[08:56] <lesshaste> interesting
[08:56] <hyperair> see /etc/sysctl.d/10-magic-sysrq.conf
[08:56] <lesshaste> how do you get sysrq? It is in small letters on the prt sc key
[08:56] <hyperair> yeah
[08:57] <lesshaste> oh I need to enable it
[08:57] <hyperair> start by trying to get hitting alt+sysrq+h. i think that dumps a help message into dmesg
[08:57] <lesshaste> it tried to take a screenshot :)
[08:57] <lesshaste> let me try  alt+shift
[08:57] <hyperair> lol
[08:57] <hyperair> i actually use the prtsc key
[08:57] <hyperair> alt+prtsc+whatever
[08:58] <hyperair> i disabled the screenshot taking though
[08:58] <lesshaste> it just tries to take a screenshot
[08:58] <hyperair> you may or may not need the fn key on a laptop
[08:59] <lesshaste> it's a desktop
[08:59] <hyperair> right
[08:59] <lesshaste> [  823.370296] SysRq : This sysrq operation is disabled.
[08:59] <hyperair> hah
[08:59] <lesshaste> so that's something :)
[08:59] <hyperair> that's something, yes
[09:00] <hyperair> see the file i mentioned
[09:00] <hyperair> it's disabled by default because an attacker trying his/her luck might get lucky and kill the screensaver process without killing X
[09:01] <lesshaste> it says kernel.sysrq = 176
[09:01] <lesshaste> which should be allow reboot/poweroff, enable remount read-only, enable sync command
[09:01] <lesshaste> how do you enable it if not in that file?
[09:02] <hyperair> sysctl kernel.sysrq=whatever
[09:02] <hyperair> as root
[09:02] <lesshaste> hyperair, so what role that does file play?
[09:02] <lesshaste> does that
[09:02] <hyperair> default sysctl setting
[09:03] <lesshaste> I mean /etc/sysctl.d/10-magic-sysrq.conf
[09:03] <hyperair> for making it persistent across reboots
[09:03] <lesshaste> what I mean is.. why isn't it enabled given that it is currentluy 176
[09:03] <hyperair> sysctl changes kernel parameters. that usually lasts until you reboot
[09:03] <hyperair> oh
[09:03] <hyperair> well
[09:03] <hyperair> i dunno
[09:03] <hyperair> what does "sysctl kernel.sysrq" say?
[09:03] <lesshaste> I should say I have an unmodified ubuntu install 
[09:04] <lesshaste> sysctl kernel.sysrq
[09:04] <lesshaste> kernel.sysrq = 176
[09:04] <hyperair> i think it just allows a certain number of functions
[09:04] <lesshaste> oh i see
[09:04] <hyperair> here's mine: [3277566.690317] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffe
[09:04] <hyperair> r(z)
[09:04] <lesshaste> what do you get from sysctl kernel.sysrq ?
[09:05] <hyperair> 1
[09:05] <lesshaste> ok done
[09:07] <lesshaste> I really need a way to do alt-sys rq+h without it taking a screenshot!
[09:08] <lesshaste> aha!
[09:08] <lesshaste> alg gr+prt sc+h does it
[09:08] <lesshaste> alt gr I mean
[09:08] <lesshaste> [ 1540.531549] SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z) 
[09:08] <lesshaste> success
[09:09] <lesshaste> so what one would kill the task that is thrashing?
[09:09] <lesshaste> which one
[09:18] <lesshaste> hyperair, thanks for you help
[12:48] <Eduard_Munteanu> Are the kernel Git repos hosted over https somewhere?
[13:14] <apw> Eduard_Munteanu, checking
[13:15] <apw> Eduard_Munteanu, yes, https:// is one of the options: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/xenial
[13:18] <Eduard_Munteanu> apw, thanks
[13:18] <Eduard_Munteanu> Any reason kernel.ubuntu.org doesn't support it, btw?
[13:18]  * Eduard_Munteanu should file a bug perhaps
[13:23] <apw> Eduard_Munteanu, likely because the machine was old and slow
[13:23] <apw> Eduard_Munteanu, the launchpad repos are going to become the official ones before long in all likelyhood
[13:24] <Eduard_Munteanu> Ah, nice.
[13:24] <apw> as that infrastructure is much more load tollerant
[13:31] <apw> Eduard_Munteanu, for xily and xenial LP is alreday master, and all others are sync'd up to LP every 15m or so
[13:32] <Eduard_Munteanu> Cool.