Lines Matching +full:many +full:- +full:to +full:- +full:many
8 KSM is a memory-saving de-duplication feature, enabled by CONFIG_KSM=y,
9 added to the Linux kernel in 2.6.32. See ``mm/ksm.c`` for its implementation,
13 Kernel Shared Memory), to fit more virtual machines into physical memory,
14 by sharing the data common between them. But it can be useful to any
15 application which generates many instances of the same data.
19 content which can be replaced by a single write-protected page (which
20 is automatically copied if a process later wants to update its
34 has advised to be likely candidates for merging, by using the madvise(2)
45 to cancel that advice and restore unshared pages: whereupon KSM
47 may suddenly require more memory than is available - possibly failing
48 with EAGAIN, but more probably arousing the Out-Of-Memory killer.
56 MADV_UNMERGEABLE is applied to a range which was never MADV_MERGEABLE.
60 will exceed ``vm.max_map_count`` (see Documentation/admin-guide/sysctl/vm.rst).
68 restricting its use to areas likely to benefit. KSM's scans may use a lot
80 how many pages to scan before ksmd goes to sleep
84 been set to scan-time.
89 how many milliseconds ksmd should sleep before next scan
96 When set to 0, ksm merges only pages which physically reside
98 latency to access of shared pages. Systems with more nodes, at
99 significant NUMA distances, are likely to benefit from the
100 lower latency of setting 0. Smaller systems, which need to
101 minimize memory usage, are likely to benefit from the greater
102 sharing of setting 1 (default). You may wish to compare how
104 which to use. ``merge_across_nodes`` setting can be changed only
105 when there are no ksm shared pages in the system: set run 2 to
106 unmerge pages first, then to 1 after changing
107 ``merge_across_nodes``, to remerge according to the new setting.
112 * set to 0 to stop ksmd from running but keep merged pages,
113 * set to 1 to run ksmd e.g. ``echo 1 > /sys/kernel/mm/ksm/run``,
114 * set to 2 to stop ksmd and unmerge all pages currently merged, but
117 Default: 0 (must be changed to 1 to activate KSM, except if
122 contain zeroes) should be treated specially. When set to 1,
137 deduplication limit to avoid high latency for virtual memory
164 enabled, pages that have previously not been de-duplicated get
166 de-duplication has already been tried and failed. By default this
172 supported: none and scan-time. The default is none. By setting
173 ``advisor_mode`` to scan-time, the scan time advisor is enabled.
182 specifies the target scan time in seconds to scan all the candidate
198 how many pages are being scanned for ksm
200 how many shared pages are being used
202 how many more sites are sharing them i.e. how much saved
204 how many pages unique but repeatedly checked for merging
206 how many pages changing too fast to be placed in a tree
208 how many pages did the "smart" page scanning algorithm skip
210 how many times all mergeable areas have been scanned
216 how many zero pages that are still mapped into processes were mapped by
223 A high ratio of ``pages_sharing`` to ``pages_shared`` indicates good
224 sharing, but a high ratio of ``pages_unshared`` to ``pages_sharing``
230 ``max_page_sharing`` tunable. To increase the ratio ``max_page_sharing`` must
237 additional memory, because it needs to generate a number of rmap_items to
239 be merged, but some may not be abled to be merged after being checked
242 1) How to determine whether KSM save memory or consume memory in system-wide
245 general_profit =~ ksm_saved_pages * sizeof(page) - (all_rmap_items) *
248 where ksm_saved_pages equals to the sum of ``pages_sharing`` +
256 process_profit =~ ksm_saved_pages * sizeof(page) -
259 where ksm_saved_pages equals to the sum of ``ksm_merging_pages`` and
265 From the perspective of application, a high ratio of ``ksm_rmap_items`` to
266 ``ksm_merging_pages`` means a bad madvise-applied policy, so developers or
267 administrators have to rethink how to change madvise policy. Giving an example
269 separately 32B on 32-bit CPU architecture and 64B on 64-bit CPU architecture.
270 so if the ``ksm_rmap_items/ksm_merging_pages`` ratio exceeds 64 on 64-bit CPU
271 or exceeds 128 on 32-bit CPU, then the app's madvise policy should be dropped,
277 There are some counters in /proc/vmstat that may be used to monitor KSM events.
280 to use KSM. For example, if cow_ksm increases too fast, user may decrease the
285 when users try to write to a KSM page, we have to make a copy.
290 cannot do all the locking needed to reconstitute a cross-anon_vma KSM page.
296 that during the startup of an application more candidate pages need to be
297 processed. Without an advisor the ``pages_to_scan`` parameter needs to be
301 The advisor can be enabled, so KSM can automatically adapt to changes in the
302 number of candidate pages to scan. Two advisors are implemented: none and
303 scan-time. With none, no advisor is enabled. The default is none.
308 ``advisor_target_scan_time`` parameter. This parameter sets the target time to
311 values make the scan time advisor to scan more aggressively. This is the most
318 The ``pages_to_scan`` parameter is re-calculated after a scan has been completed.
321 --