]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc_buddyinfo.5
proc_sys.5, proc_sys_vm.5: Split /proc/sys/vm/ from proc_sys(5)
[thirdparty/man-pages.git] / man5 / proc_buddyinfo.5
CommitLineData
070a30bc
AC
1.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4.\"
5.\" SPDX-License-Identifier: GPL-3.0-or-later
6.\"
7.TH proc_buddyinfo 5 (date) "Linux man-pages (unreleased)"
8.SH NAME
9/proc/buddyinfo \- memory fragmentation
10.SH DESCRIPTION
11.TP
12.I /proc/buddyinfo
13This file contains information which is used for diagnosing memory
14fragmentation issues.
15Each line starts with the identification of the node and the name
16of the zone which together identify a memory region.
17This is then
18followed by the count of available chunks of a certain order in
19which these zones are split.
20The size in bytes of a certain order is given by the formula:
21.IP
22.in +4n
23.EX
24(2\[ha]order)\ *\ PAGE_SIZE
25.EE
26.in
27.IP
28The binary buddy allocator algorithm inside the kernel will split
29one chunk into two chunks of a smaller order (thus with half the
30size) or combine two contiguous chunks into one larger chunk of
31a higher order (thus with double the size) to satisfy allocation
32requests and to counter memory fragmentation.
33The order matches the column number, when starting to count at zero.
34.IP
35For example on an x86-64 system:
36.RS -12
37.EX
38Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3
39Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404
40Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587
41.EE
42.RE
43.IP
44In this example, there is one node containing three zones and there
45are 11 different chunk sizes.
46If the page size is 4 kilobytes, then the first zone called
47.I DMA
48(on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes
49(order 0) available and has 3 chunks of 4 megabytes (order 10) available.
50.IP
51If the memory is heavily fragmented, the counters for higher
52order chunks will be zero and allocation of large contiguous areas
53will fail.
54.IP
55Further information about the zones can be found in
56.IR /proc/zoneinfo .
57.SH SEE ALSO
58.BR proc (5)