2021-12-11 19:51:20

by Anssi Hannula

[permalink] [raw]
Subject: [PATCH] docs/vm: clarify overcommit amount sysctl behavior

Documentation/vm/overcommit-accounting.rst says that the overcommit
amount can be set via vm.overcommit_ratio and vm.overcommit_kbytes.

Add a clarification that those only take effect in overcommit handling
mode 2 ("Don't overcommit"), i.e. they do not act as an "additional"
limit that is always enforced.

Signed-off-by: Anssi Hannula <[email protected]>
---

I've had to look this one up in the code enough times already :)


Documentation/vm/overcommit-accounting.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/vm/overcommit-accounting.rst b/Documentation/vm/overcommit-accounting.rst
index 0dd54bbe4afa..1addb0c374a4 100644
--- a/Documentation/vm/overcommit-accounting.rst
+++ b/Documentation/vm/overcommit-accounting.rst
@@ -34,7 +34,8 @@ The Linux kernel supports the following overcommit handling modes
The overcommit policy is set via the sysctl ``vm.overcommit_memory``.

The overcommit amount can be set via ``vm.overcommit_ratio`` (percentage)
-or ``vm.overcommit_kbytes`` (absolute value).
+or ``vm.overcommit_kbytes`` (absolute value). These only have an effect
+when ``vm.overcommit_memory`` is set to 2.

The current overcommit limit and amount committed are viewable in
``/proc/meminfo`` as CommitLimit and Committed_AS respectively.
--
2.31.1



2021-12-11 22:21:49

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH] docs/vm: clarify overcommit amount sysctl behavior

On Sat, Dec 11, 2021 at 09:41:59PM +0200, Anssi Hannula wrote:
> Documentation/vm/overcommit-accounting.rst says that the overcommit
> amount can be set via vm.overcommit_ratio and vm.overcommit_kbytes.
>
> Add a clarification that those only take effect in overcommit handling
> mode 2 ("Don't overcommit"), i.e. they do not act as an "additional"
> limit that is always enforced.
>
> Signed-off-by: Anssi Hannula <[email protected]>
> ---

Simple and clear improvement, IMO. Cc'ing linux-mm to get more eyes on
it.

> I've had to look this one up in the code enough times already :)
>
>
> Documentation/vm/overcommit-accounting.rst | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/vm/overcommit-accounting.rst b/Documentation/vm/overcommit-accounting.rst
> index 0dd54bbe4afa..1addb0c374a4 100644
> --- a/Documentation/vm/overcommit-accounting.rst
> +++ b/Documentation/vm/overcommit-accounting.rst
> @@ -34,7 +34,8 @@ The Linux kernel supports the following overcommit handling modes
> The overcommit policy is set via the sysctl ``vm.overcommit_memory``.
>
> The overcommit amount can be set via ``vm.overcommit_ratio`` (percentage)
> -or ``vm.overcommit_kbytes`` (absolute value).
> +or ``vm.overcommit_kbytes`` (absolute value). These only have an effect
> +when ``vm.overcommit_memory`` is set to 2.
>
> The current overcommit limit and amount committed are viewable in
> ``/proc/meminfo`` as CommitLimit and Committed_AS respectively.
> --
> 2.31.1
>

2021-12-16 11:02:06

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH] docs/vm: clarify overcommit amount sysctl behavior

On 11.12.21 23:21, Matthew Wilcox wrote:
> On Sat, Dec 11, 2021 at 09:41:59PM +0200, Anssi Hannula wrote:
>> Documentation/vm/overcommit-accounting.rst says that the overcommit
>> amount can be set via vm.overcommit_ratio and vm.overcommit_kbytes.
>>
>> Add a clarification that those only take effect in overcommit handling
>> mode 2 ("Don't overcommit"), i.e. they do not act as an "additional"
>> limit that is always enforced.
>>
>> Signed-off-by: Anssi Hannula <[email protected]>
>> ---
>
> Simple and clear improvement, IMO. Cc'ing linux-mm to get more eyes on
> it.

As I had the same idea to just make this clearer in the context of
advanced documentation for virtio-mem, so I approve :)

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb


2021-12-16 22:53:39

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] docs/vm: clarify overcommit amount sysctl behavior

David Hildenbrand <[email protected]> writes:

> On 11.12.21 23:21, Matthew Wilcox wrote:
>> On Sat, Dec 11, 2021 at 09:41:59PM +0200, Anssi Hannula wrote:
>>> Documentation/vm/overcommit-accounting.rst says that the overcommit
>>> amount can be set via vm.overcommit_ratio and vm.overcommit_kbytes.
>>>
>>> Add a clarification that those only take effect in overcommit handling
>>> mode 2 ("Don't overcommit"), i.e. they do not act as an "additional"
>>> limit that is always enforced.
>>>
>>> Signed-off-by: Anssi Hannula <[email protected]>
>>> ---
>>
>> Simple and clear improvement, IMO. Cc'ing linux-mm to get more eyes on
>> it.
>
> As I had the same idea to just make this clearer in the context of
> advanced documentation for virtio-mem, so I approve :)
>
> Reviewed-by: David Hildenbrand <[email protected]>

Applied, thanks.

jon