Found out that man page for delete_module syscall is outdated.The behaviour described there doesn't match to code, specifically for unloading module if its have no refcnt. Parameter O_NONBLOCK described in man doesn't exist anymore in kernel versions 3.13+, which is quite old, only O_TRUNC parameter present for actual kernel version, O_NONBLOCK does nothing. I've also opened an issue on bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218489