diff --git a/README.md b/README.md index 39db44e..ce8acff 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,18 @@ Also look at [Why are low memory conditions handled so badly?](https://www.reddi For basic usage: - `Linux` 3.14+ (since `MemAvailable` appeared in `/proc/meminfo`) -- `Linux` 4.20+ if you want to use `PSI` - `Python` 3.3+ (not tested with previous) To show GUI notifications: - `libnotify` (Fedora, Arch Linux) or `libnotify-bin` (Debian GNU/Linux, Ubuntu) - `sudo` if nohang started with UID=0 +To use `PSI` (pressure stall information): +- `Linux` 4.20+ + ## Memory and CPU usage -- VmRSS is 10 — 14 MiB depending on the settings (about 10 MiB by default) +- VmRSS is 10 — 11 MiB depending on the settings - CPU usage depends on the level of available memory (the frequency of memory status checks increases as the amount of available memory decreases) and monitoring intensity (can be changed by the user via the config) ## Download, install, uninstall @@ -119,8 +121,7 @@ The program can be configured by editing the [config file](https://github.com/ha 6. GUI notifications: - results of preventing OOM - low memory warnings -7. Preventing the slowing down of the program -8. Output verbosity +7. Output verbosity Just read the description of the parameters and edit the values. Please restart nohang to apply changes. Default path to the config after installing is `/etc/nohang/nohang.conf`. diff --git a/nohang b/nohang index 61a6993..9a68b62 100755 --- a/nohang +++ b/nohang @@ -16,9 +16,12 @@ from signal import SIGKILL, SIGTERM sig_dict = {SIGKILL: 'SIGKILL', SIGTERM: 'SIGTERM'} -self_uid = os.geteuid() self_pid = str(os.getpid()) +self_uid = os.geteuid() +if self_uid == 0: + root = True + wait_time = 2 cache_time = 30 cache_path = '/dev/shm/nohang_env_cache'