[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-bugs
Subject:    [haiku-bugs] Re: [Haiku] #16622: kernel: system_info.used_pages don't include mapped files
From:       "Haiku" <trac () haiku-os ! org>
Date:       2020-11-29 15:50:04
Message-ID: 055.1cb0223510b2a666c5883d91a89b9441 () haiku-os ! org
[Download RAW message or body]

--===============7685493344491285909==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

#16622: kernel: system_info.used_pages don't include mapped files
----------------------------+----------------------------
  Reporter:  X512           |      Owner:  nobody
      Type:  bug            |     Status:  new
  Priority:  normal         |  Milestone:  Unscheduled
 Component:  System/Kernel  |    Version:  R1/Development
Resolution:                 |   Keywords:
Blocked By:                 |   Blocking:
  Platform:  All            |
----------------------------+----------------------------
Description changed by X512:

Old description:

> This is hrev54741.
>
> As discussed [https://discuss.haiku-os.org/t/app-server-font-cache-is-
> causing-high-cpu-load-in-low-resource-manager-thread-and-cause-
> mysterious-resource-exhaustment/10147/13 here], mapping files to read-
> only areas almost not affect `system_info.used_pages` that is used by
> most memory inspecting utilities, but it actually consumes memory and
> make allocations not possible if too many files are mapped.
> `system_info.free_memory` provides correct information about free memory
> but is also seems to include disk cache that can be freed to release
> memory for allocations.
>
> If memory mapped files are consuming memory, they should be included in
> `system_info.used_pages`.
>
> Actually it is not required to reserve memory for read-only mapped files
> because it can be handled in similar way as disk cache: load file
> contents on demand and unload when memory is needed by someone else. This
> approach do not violate no overcommit policy. If program change area
> protection and enable copy-on-write, attempt may failed with out of
> memory if memory can't be reserved.

New description:

 This is hrev54741.

 As discussed [https://discuss.haiku-os.org/t/app-server-font-cache-is-
 causing-high-cpu-load-in-low-resource-manager-thread-and-cause-mysterious-
 resource-exhaustment/10147/13 here], mapping files to read-only areas
 almost not affect `system_info.used_pages` that is used by most memory
 inspecting utilities, but it actually consumes memory and make allocations
 not possible if too many files are mapped. `system_info.free_memory`
 provides correct information about free memory but is also seems to
 include disk cache that can be freed to release memory for allocations.

 If memory mapped files are consuming memory, they should be included in
 `system_info.used_pages`.

 Actually it is not required to reserve memory for read-only mapped files
 because it can be handled in similar way as disk cache: load file contents
 on demand and unload when memory is needed by someone else. This approach
 do not violate no overcommit policy. If program change area protection and
 enable copy-on-write, attempt may failed with out of memory if memory
 can't be reserved.

 `system_info.used_pages` is calculated
 [https://xref.landonf.org/source/xref/haiku/src/system/kernel/vm/vm_page.c=
pp#4106
 here].

--
-- =

Ticket URL: <https://dev.haiku-os.org/ticket/16622#comment:5>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.
--===============7685493344491285909==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic