Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2022 12:55:56 +0000
From:      ralph41096 <ralph41096@protonmail.com>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Out-of-swap killer and SIGTERM signal
Message-ID:  <ulzJKQSiG37ZtJR9pE-IasT-K1hqpq__htA_JbNJkDkVLD4MeGtXg59rltE6VhKB74U8ztlapijvd6i62-QJ_CVDrOdWubywhbWznmwVa1U=@protonmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

Do you think it would be a good idea to introduce the following soft
mode for the Out-of-swap killer?

Old behaviour:
  1) If there is no free swap space left, send SIGKILL signals to the
     condemned processes. (This is the hard mode.)

New behaviour:
  1) If there is less than 2 GiB of free swap space, send SIGTERM
     signals to the condemned processes, then wait for a 5 seconds
     grace period, then send SIGKILL signals to the condemned processes
     who are still running.
  2) Repeat step 1) until the amount of free swap space becomes greater
     than 2 GiB. (This is the soft mode.)
  3) If the soft mode does not release swap space fast enough, and the
     amount of free swap space becomes zero, enter hard mode and
     immediately send SIGKILL signals to the condemned processes.

These two system-wide parameters (2 GiB of free swap space, 5 seconds
grace period) could be defined in a configuration file, to allow the
administrator to change them.

The intent is to allow condemned processes to write some data on
persistent storage and exit gracefully, when the shortage of swap space
does not happen too quickly.

Ambert




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ulzJKQSiG37ZtJR9pE-IasT-K1hqpq__htA_JbNJkDkVLD4MeGtXg59rltE6VhKB74U8ztlapijvd6i62-QJ_CVDrOdWubywhbWznmwVa1U=>