From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8877FC021B2 for ; Mon, 24 Feb 2025 01:43:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21F396B0085; Sun, 23 Feb 2025 20:43:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CE7D6B0088; Sun, 23 Feb 2025 20:43:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06F446B0089; Sun, 23 Feb 2025 20:43:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DC46A6B0085 for ; Sun, 23 Feb 2025 20:43:41 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4B96680659 for ; Mon, 24 Feb 2025 01:43:41 +0000 (UTC) X-FDA: 83153141442.13.1F01C99 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf26.hostedemail.com (Postfix) with ESMTP id 4B5BA140003 for ; Mon, 24 Feb 2025 01:43:39 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AqmUc0PX; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740361419; a=rsa-sha256; cv=none; b=7UYIdhjU3QrSj7yY95K/Jxsn8BM8eCypYM03bFv5L/vGWri9Den3WpXkBzLS0Runp85SCo MVfmusYFlu0dx7b7Maf77U4EWTpHMgn7xRpnQb+eZc54lbQB1zMWNXAx+V2ZoEL4MuWVTb gpbzrnOZtnw6qJQyM12SJzGKY91iXjo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=AqmUc0PX; spf=pass (imf26.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740361419; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cB4bxYAMQ9VenSnuFbkUpppNf2x/mTeUTjCdr95qJ/c=; b=W444wK3bQK+lASkkk5Dt2mn0utF+kzRmPJ2sSbIQNy+oSeMjeN9I43Yx8XPbm9o56SyZ6u tNC0gLiuvZjcI/P2UbWNZZQ9wUUAjsJzWxZCrYLez34Y987Q0u29qjmQA5OgCxOGUF6rTr mGDSbDy7X3zET47Ob1RnQjidzM1BhCs= Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-220ecbdb4c2so105555905ad.3 for ; Sun, 23 Feb 2025 17:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740361418; x=1740966218; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cB4bxYAMQ9VenSnuFbkUpppNf2x/mTeUTjCdr95qJ/c=; b=AqmUc0PXILRIcdtcVYwd6r3y1RXraf4amEAGHwn4cmDGqIm/lkveHrznxuUh4ZVEyC q90/uHl6pjxRdLBMR6nbUkcbHg19zC8BYO3E21OoHXY1VumGKjEiXKfC1TyzSQdKMF88 56lEtvTG6Vd3QRsN6r/wyEewfERWkmhCrmjyWh3k/5NauMSC92kMr66oZdV7Qj+Nh8FI kNsyhqfJ/akyNqMTDDIwYj33/ZZ0Hgbz/5+E9XxQadSeVr+AnPGAEsYeC1Kw+KfxgKpg 7HlxTwlCh3krgRNQ+jlFPGwBvYCXSWgrJBbpJBB5CfY27rRgQCFZvqJSHFENWV8gsBR3 0kFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740361418; x=1740966218; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cB4bxYAMQ9VenSnuFbkUpppNf2x/mTeUTjCdr95qJ/c=; b=XLYFfKc08icgajSfc+VJ1RqzEj6bgVk6ORAcpUl/bwnfBRgFArPmUP3IbTJNf5zHQS wIQkI6cnkSPUzuQDp2eWPD/S3x8GuTtxGuORRuCLT2LIE4RMzV31HaxcZ/Mg5/vrlyuY 6z0xCpENsUJDLSyVfxD5jyyhRISjhiF1TCg7ukwUVh7v0Uk/LNe42uO2JYXuYf5vtcvp xakJ8ArNeJd+VFxz4F5Il/tlHdPXmTKt6oAS2+RFbHGsNVsBcNxz+dn5isAmEwtUYVL1 vzzRBLOan/qHN7HUl0eJIJXa0G3RQvsr/pTIxyPBPzQi6Q7+ei8Y1pCx1P4feKH+h8Ot kKdw== X-Forwarded-Encrypted: i=1; AJvYcCVommy6tynNKmmhy1UJHZbYHFa6jL0UJf6gATqUyIPYwFDTMWvymn3fogcMJwfjC40ZhpGwm9dpZA==@kvack.org X-Gm-Message-State: AOJu0YzuCIlUWokAqIdsq1eKZkbdKPPEXcohcKP0LrZljWigafXs6dql WG3ZlbnRTeQCSt60gW+6HwfjHcG4G+rVd+NPcfm1I0HJXQoMmFd0 X-Gm-Gg: ASbGnct1xbP2+tzatquwGuZ37spNdHGqgWFT3ec0IaQc61yIMOqDx1mQS0uCv5X5sGN wqLnd+Wr0ROpcfqeXfZMZdU+9bzixnEAokSvhUea9e2BJu+3/pXN/52vNF7JyKCsXRO3jpVNnU2 2SnoKM4PzlYN4s4HA9cebMTkjGKT8KI8O3cAEwC3wXHsLLHoqlvbw1eu9k3d+4bDJDQjuKwVNAj czUv5ZVYmHHu7KOC1oP+FwqxXuZGqcIxW+ULjDGd3rw4ijJ+3YEfxN/bThJtWUF+JMfZhaq5EHO gL4Em87IUiGEo5ZMFb8XE5daBQ== X-Google-Smtp-Source: AGHT+IGVzL7zs1RZdDMdsoy/mR5B026KhVJ1hgHKZYTJKivvG7eWwbYnrMwlsUjxzqS3cWuRZtMZvQ== X-Received: by 2002:a17:903:1cc:b0:220:e336:94e with SMTP id d9443c01a7336-221a0ed738emr170388865ad.15.1740361417725; Sun, 23 Feb 2025 17:43:37 -0800 (PST) Received: from archie.me ([103.124.138.155]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-220d545cff5sm166764945ad.125.2025.02.23.17.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2025 17:43:36 -0800 (PST) Received: by archie.me (Postfix, from userid 1000) id 29C864209E40; Mon, 24 Feb 2025 08:43:33 +0700 (WIB) Date: Mon, 24 Feb 2025 08:43:33 +0700 From: Bagas Sanjaya To: Jiwen Qi , akpm@linux-foundation.org Cc: corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, Mike Rapoport Subject: Re: [PATCH] docs/mm: Physical Memory: Populate the "Zones" section Message-ID: References: <20250223185359.338647-1-jiwen7.qi@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9QNy9+WpE7ZOOuNh" Content-Disposition: inline In-Reply-To: <20250223185359.338647-1-jiwen7.qi@gmail.com> X-Stat-Signature: s3cbgmeohy659966dyb7u5cj9m5mjnps X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 4B5BA140003 X-Rspam-User: X-HE-Tag: 1740361419-786480 X-HE-Meta: U2FsdGVkX1/6BZBVFpAdED4wbKVgQpWoxJB5S3QkGg1Dc67XR7QCbz2zkU//TJiCfzxm5ZC54AkjeiuK5aa3wHNfYOfFI3lniI1KShfPPLfm7vXWAIudQ4nhJN5ed1/yFD7lTpmpFvaZKfnELMbtAerfh0UfmpRRuT7Lb02DR3EXzbXiEcAdQ2nEYf3LOYkjc4Xujh5m5t8VtP9sOh0e1bQrqWhDoNcj56pIQBZlTLE+ri5+638alKdlsdzJe3lAL3XAfn6frongeUPnW0LxPTeIFdAga1GnvWYbsWQ+RLNP95slOTTunfnPEhbmobmF9SRtNysd7UGqr2phqeCZegCo1msp7zsSL5+Myum0m4eQ4MHyJCkXmIiTFWG7HJfJihKSivw5miqnfEH7MBOgWPgtZsZE2CgfuB7mY1ssTfG7q6DYLysTHs9xsIkQZLMIIPdwl10Rlei1ZD+VM+Sit4RJGJ6/0JFV/pg2ydPpt2HSfeaZmBJ/mWBn3gVLkdjnTwXwmWt3HcRZnyhXKjnzkgmhI2djGFso1p35WMMCVrxR2y+2EL9q7Lk6uSN+ZFv13NhvzdWXUKbPsy1ec699Kk3U+eFezp15WxknTkei0RnRsHWtHxvfgNOxGJdECXTd4MVuy/wnizM+PCfMgvUfh2DAuBpaDDJDBk8rOYXCWxypus1JBEsdkWSXKd8rsp4rFt1ttNHywuGc3t/Uft8ukgb707z0Sqa9+5omNdlNXHcpfgSGs5dbiZnzZUIWXlpvBVod5+xPkpZ3YiBMUBJjXFBOYiOmSxt0kc/LUTktjT1lfDeUkYjLJLb3Ma3XL5QJQercevAQ+wfRKM0hQuYWrHWtA4ZyHrihIi0Cnrx/bDeYmmUrry24p54VuOEZOTUkb7V4AMlpejTlReyKbyIlnkX82bHwJD7LSIKnmhKhOziVJjGXFD6/1mLb8hx8NoC9frPrvQ9/GKMuTwpbv3a HS3VD3C1 QmHlLbfXXENyAKSjNZ6QyL63tlbNBhdCp4qLfBJddGELkpt4SxNLY3EfmRcVDRaVC9ewY7pIfP4Z5uuqO3DH6PCEW2nqhCN9owI0deJcHvXmU4DB8n218mah6LXFtevT75YqdtrYxn+21y8hWcOUJEPTqvafg0L1DHrmOfaCG2DfU7cTopOQXxMy9kUmIjyrvWlaLyD+YoBv7li32N6D6gIsXbnGJCSuwFH54kZnkEmjHKhDC1JmEjIKSb4qSv7bg42E4acF/1dVChHuKjgqgWse+aIgshkrQMtlz9FJK61uBr70YC9sz3MJZ7MdSCqTbGDgQ7ugobAQ5eS8FREH/pUBGsUYtn/vA9yv/1EvuM24Ob5ak+fcCd0m98NjGBUnDhRFAhi08JCe/FbKBoMQn5bvNlqs+kRzX6GQnZ4j2jwFW6YHXL29QoQ0L7cH4NO53/yVX5SZ9TObw2bHbZlxznm66Gu/E74ot+4Dg5ueNnfN8KLZ5NEdaokqL1FuhoKTbLAhmozD3Mmjq+YiJVlZPaPhrcISZEkti76PD4drA15fWC9g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --9QNy9+WpE7ZOOuNh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 23, 2025 at 06:53:59PM +0000, Jiwen Qi wrote: > Briefly describe what zones are and the fields of struct zone. >=20 Cc'ing Mike. > Signed-off-by: Jiwen Qi > --- > Documentation/mm/physical_memory.rst | 259 ++++++++++++++++++++++++++- > 1 file changed, 257 insertions(+), 2 deletions(-) >=20 > diff --git a/Documentation/mm/physical_memory.rst b/Documentation/mm/phys= ical_memory.rst > index 71fd4a6acf42..227997694851 100644 > --- a/Documentation/mm/physical_memory.rst > +++ b/Documentation/mm/physical_memory.rst > @@ -338,10 +338,265 @@ Statistics > =20 > Zones > =3D=3D=3D=3D=3D > +As we have mentioned, each zone in memory is described by a ``struct zon= e`` > +which is an element of the ``node_zones`` field of the node it belongs t= o. A > +zone represents a range of physical memory. A zone may have holes. The ..., and may have holes. > +``spanned_pages`` field represents the total pages spanned by the zone, > +the ``present_pages`` field represents the physical pages existing withi= n the ; and the ... > +zone and the managed_page field represents the pages managed by the budd= y system. > + > +Linux uses the GFP flags, see ``include/linux/gfp_types.h``, specified by or (see :ref:`Documentation/core-api/mm-api.rst <= mm-api-gfp-flags>` for reference on these flags)? > +a memory allocation to determine the highest zone in a node from which > +the memory allocation can allocate memory. Linux first allocates memory = =66rom The kernel first ... > +that zone, if Linux can't allocate the requested amount of memory from t= he zone, > +it will allocate memory from the next lower zone in the node, the process > +continues up to and including the lowest zone. For example, if a node co= ntains > +``ZONE_DMA32``, ``ZONE_NORMAL`` and ``ZONE_MOVABLE`` and the highest zon= e of a > +memory allocation is ``ZONE_MOVABLE``, the order of the zones from which= Linux > +allocates memory is ``ZONE_MOVABLE`` > ``ZONE_NORMAL`` > ``ZONE_DMA32``. =2E.. from which the kernel allocates ... > + > +At runtime, free pages in a zone are in the Per-CPU Pagesets (PCP) or fr= ee areas > +of the zone. The Per-CPU Pagesets is pointed by the ``per_cpu_pageset`` = filed. > +The free areas is pointed by the ``free_area`` field. The Per-CPU Pagese= ts are > +a vital mechanism in the Linux kernel's memory management system. By han= dling > +most frequent allocations and frees locally on each CPU, the Per-CPU Pag= esets > +improve performance and scalability, especially on systems with many cor= es. The > +page allocator in the Linux kernel employs a two-step strategy for memory > +allocation, starting with the Per-CPU Pagesets before falling back to th= e buddy > +allocator. Pages are transferred between the Per-CPU Pagesets and the gl= obal > +free areas (managed by the buddy allocator) in batches. This minimizes t= he > +overhead of frequent interactions with the global buddy allocator. Free = areas in > +a zone are represented by an array of ``free_area``, where each element > +corresponds to a specific order which is a power of two." > + > +Architecture specific code calls free_area_init() to initializes zones. > + > +Zone structure > +-------------- > =20 > -.. admonition:: Stub > +The zones structure ``struct zone`` is declared in ``include/linux/mmzon= e.h``. ... defined in ... > +Here we briefly describe fields of this structure: > =20 > - This section is incomplete. Please list and describe the appropriate = fields. > +General > +~~~~~~~ > + > +``_watermark`` > + The watermarks for this zone. The min watermark is the point where boo= sting is > + ignored and an allocation may trigger direct reclaim and direct compac= tion. > + It is also used to throttle direct reclaim. The low watermark is the p= oint > + where kswapd is woken up. The high watermark is the point where kswapd= stops > + reclaiming (a zone is balanced) when the ``NUMA_BALANCING_MEMORY_TIERI= NG`` > + bit of ``sysctl_numa_balancing_mode`` is not set. The promo watermark = is used > + for memory tiering and NUMA balancing. It is the point where kswapd st= ops > + reclaiming when the ``NUMA_BALANCING_MEMORY_TIERING`` bit of > + ``sysctl_numa_balancing_mode`` is set. The watermarks are set by > + ``__setup_per_zone_wmarks()``. the min watermark is calculated accordi= ng to > + ``vm.min_free_kbytes`` sysctl. The other three watermarks are set acco= rding > + to the distance between two watermarks. The distance is caculated acco= rding > + to ``vm.watermark_scale_factor`` sysctl. The distance itself is calculated taking ``vm.watermark_scale_factor`` into account. > + > +``watermark_boost`` > + The number of pages which are used to boost watermarks to increase rec= laim > + pressure to reduce the likelihood of future fallbacks and wake kswapd = now > + as the node may be balanced overall and kswapd will not wake naturally. > + > +``nr_reserved_highatomic`` > + The number of pages which are reserved for high-order atomic allocatio= ns. > + > +``nr_free_highatomic`` > + The number of free pages in reserved highatomic pageblocks > + > +``lowmem_reserve`` > + The array of the amounts of the memory reserved in this zone for memory > + allocations. For example, if the highest zone a memory allocation can > + allocate memory from is ``ZONE_MOVABLE``, the amount of memory reserve= d in > + this zone for this allocation is ``lowmem_reserve[ZONE_MOVABLE]`` when > + attempting to allocate memory from this zone. The reason is that we do= n't know > + if the memory that we're going to allocate will be freeable or/and it = will be > + released eventually, so to avoid totally wasting several GB of ram we = must > + reserve some of the lower zone memory (otherwise we risk to run OOM on= the > + lower zones despite there being tons of freeable ram on the higher zon= es). > + This array is recalculated by ``setup_per_zone_lowmem_reserve()`` at r= untime > + if ``vm.lowmem_reserve_ratio`` sysctl changes. > + > +``node`` > + The index of the node this zone belongs to. Available only when > + ``CONFIG_NUMA`` is enabled because there is only one zone in a UMA sys= tem. > + > +``zone_pgdat`` > + Pointer to the pglist_data of the node this zone belongs to. > + > +``per_cpu_pageset`` > + Pointer to the Per-CPU Pagesets (PCP) allocated and initialized by > + ``setup_zone_pageset()``. By handling most frequent allocations and fr= ees > + locally on each CPU, the Per-CPU Pagesets improve performance and scal= ability PCP improves ... > + on systems with many cores. > + > +``pageset_high_min`` > + Copied to the ``high_min`` of the Per-CPU Pagesets for faster access. > + > +``pageset_high_max`` > + Copied to the ``high_max`` of the Per-CPU Pagesets for faster access. > + > +``pageset_batch`` > + Copied to the ``batch`` of the Per-CPU Pagesets for faster access. The > + ``batch``, ``high_min`` and ``high_max`` of the Per-CPU Pagesets are u= sed to > + calculate the number of elements the Per-CPU Pagesets obtain from the = buddy > + allocator under a single hold of the lock for efficiency. They are als= o used > + to decide if the Per-CPU Pagesets return pages to the buddy allocator = in page > + free process. > + > +``pageblock_flags`` > + The pointer to the flags for the pageblocks in the system. See > + ``include/linux/pageblock-flags.h``. The memory is allocated in (see ``include/linux/pageblock-flags.h`` for flags list). > + ``setup_usemap()``. Each pageblock occupies ``NR_PAGEBLOCK_BITS`` bits. > + Defined only when ``CONFIG_FLATMEM`` is enabled. The flags is stored in > + ``mem_section`` when ``CONFIG_SPARSEMEM`` is enabled. > + > +``zone_start_pfn`` > + The start pfn of the zone. It is initialized by > + ``calculate_node_totalpages()``. > + > +``managed_pages`` > + The present pages managed by the buddy system, which is calculated as: > + ``managed_pages`` =3D ``present_pages`` - ``reserved_pages``, ``reserv= ed_pages`` > + includes pages allocated by the memblock allocator. It should be used = by page > + allocator and vm scanner to calculate all kinds of watermarks and thre= sholds. > + It is accessed using ``atomic_long_xxx()`` functions. It is initialize= d in > + ``free_area_init_core()`` and then is reinitialized when memblock allo= cator > + frees pages into buddy system. > + > +``spanned_pages`` > + The total pages spanned by the zone, including holes, which is calcula= ted as: > + ``spanned_pages`` =3D ``zone_end_pfn`` - ``zone_start_pfn``. It is ini= tialized > + by ``calculate_node_totalpages()``. > + > +``present_pages`` > + The physical pages existing within the zone, which is calculated as: > + ``present_pages`` =3D ``spanned_pages`` - ``absent_pages`` (pages in h= oles). It > + may be used by memory hotplug or memory power management logic to figu= re out > + unmanaged pages by checking (``present_pages`` - ``managed_pages``). W= rite > + access to ``present_pages`` at runtime should be protected by > + ``mem_hotplug_begin/done()``. Any reader who can't tolerant drift of > + ``present_pages`` should use ``get_online_mems()`` to get a stable val= ue. It > + is initialized by ``calculate_node_totalpages()``. > + > +``present_early_pages`` > + The present pages existing within the zone located on memory available= since > + early boot, excluding hotplugged memory. Defined only when > + ``CONFIG_MEMORY_HOTPLUG`` is enabled and initialized by > + ``calculate_node_totalpages()``. > + > +``cma_pages`` > + The pages reserved for CMA use. These pages behave like ``ZONE_MOVABLE= `` when > + they are not used for CMA. Defined only when ``CONFIG_CMA`` is enabled. > + > +``name`` > + The name of the zone. It is a pointer to the corresponding element of > + the ``zone_names`` array. > + > +``nr_isolate_pageblock`` > + Number of isolated pageblocks. It is used to solve incorrect freepage = counting > + problem due to racy retrieving migratetype of pageblock. Protected by > + ``zone->lock``. Defined only when ``CONFIG_MEMORY_ISOLATION`` is enabl= ed. > + > +``span_seqlock`` > + The seqlock to protect ``zone_start_pfn`` and ``spanned_pages``. It is= a > + seqlock because it has to be read outside of ``zone->lock``, and it is= done in > + the main allocator path. But, it is written quite infrequently. Defin= ed only However, the seqlock is ... > + when ``CONFIG_MEMORY_HOTPLUG`` is enabled. > + > +``initialized`` > + The flag indicating if the zone is initialized. Set by > + ``init_currently_empty_zone()`` during boot. > + > +``free_area`` > + Free areas of different sizes. It is initialized by ``zone_init_free_l= ists()``. > + > +``unaccepted_pages`` > + The list of pages to be accepted. All pages on the list are ``MAX_PAGE= _ORDER``. > + Defined only when ``CONFIG_UNACCEPTED_MEMORY`` is enabled. > + > +``flags`` > + The zone flags. The least three bits are used and defined by > + ``enum zone_flags``. ``ZONE_BOOSTED_WATERMARK`` (bit 0): zone recently= boosted > + watermarks. Cleared when kswapd is woken. ``ZONE_RECLAIM_ACTIVE`` (bit= 1): > + kswapd may be scanning the zone. ``ZONE_BELOW_HIGH`` (bit 2): zone is = below > + high watermark. > + > +``lock`` > + The main lock that protects the internal data structures of the page a= llocator > + specific to the zone, especially protects ``free_area``. > + > +``percpu_drift_mark`` > + When free pages are below this point, additional steps are taken when = reading > + the number of free pages to avoid per-cpu counter drift allowing water= marks > + to be breached. It is updated in ``refresh_zone_stat_thresholds()``. > + > +Compaction control > +~~~~~~~~~~~~~~~~~~ > + > +``compact_cached_free_pfn`` > + The PFN where compaction free scanner should start in the next scan. > + > +``compact_cached_migrate_pfn`` > + The PFNs where compaction migration scanner should start in the next s= can. > + This array has two elements, the first one is used in ``MIGRATE_ASYNC`= ` mode, > + the other is used in ``MIGRATE_SYNC`` mode. This array has two elements: the first one is ..., and the other one is ... > + > +``compact_init_migrate_pfn`` > + The initial migration PFN which is initialized to 0 at boot time, and = to the > + first pageblock with migratable pages in the zone after a full compact= ion > + finishes. It is used to check if a scan is a whole zone scan or not. > + > +``compact_init_free_pfn`` > + The initial free PFN which is initialized to 0 at boot time and to the= last > + pageblock with free ``MIGRATE_MOVABLE`` pages in the zone. It is used = to check > + if it is the start of a scan. > + > +``compact_considered`` > + The number of compactions attempted since last failure. It is reset in > + ``defer_compaction()`` when a compaction fails to result in a page all= ocation > + success. It is increased by 1 in ``compaction_deferred()`` when a comp= action > + should be skipped. ``compaction_deferred()`` is called before > + ``compact_zone()`` is called, ``compaction_defer_reset()`` is called w= hen > + ``compact_zone()`` returns ``COMPACT_SUCCESS``, ``defer_compaction()``= is > + called when ``compact_zone()`` returns ``COMPACT_PARTIAL_SKIPPED`` or > + ``COMPACT_COMPLETE``. > + > +``compact_defer_shift`` > + The number of compactions skipped before trying again is > + ``1< + It is reset in ``compaction_defer_reset()`` when a direct compaction r= esults > + in a page allocation success. Its maximum value is ``COMPACT_MAX_DEFER= _SHIFT``. > + > +``compact_order_failed`` > + The minimum compaction failed order. It is set in ``compaction_defer_r= eset()`` > + when a compaction succeeds and in ``defer_compaction()`` when a compac= tion > + fails to result in a page allocation success. > + > +``compact_blockskip_flush`` > + Set to true when compaction migration scanner and free scanner meet, w= hich > + means the ``PB_migrate_skip`` bits should be cleared. > + > +``contiguous`` > + Set to true when the zone is contiguous (there is no hole). (in other words, no hole). > + > +Statistics > +~~~~~~~~~~ > + > +``vm_stat`` > + VM statistics for the zone. The items tracked are defined by > + ``enum zone_stat_item``. > + > +``vm_numa_event`` > + VM NUMA event statistics for the zone. The items tracked are defined by > + ``enum numa_stat_item``. > + > +``per_cpu_zonestats`` > + Per-CPU VM statistics for the zone. It records VM statistics and VM NU= MA event > + statistics on a per-CPU basis. It reduces updates to the global ``vm_s= tat`` > + and ``vm_numa_event`` fields of the zone to improve performance. > =20 > .. _pages: > =20 >=20 Thanks. --=20 An old man doll... just what I always wanted! - Clara --9QNy9+WpE7ZOOuNh Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCZ7vOwAAKCRD2uYlJVVFO o+MfAQDaNST5lw7YfNFlVcVoZNGpu/wkMLCFZB/RpCiXLhM+ngEA6mit48MAhz17 45JBdAOwNrcbV72aNvl1nLue8KdZogM= =lSy7 -----END PGP SIGNATURE----- --9QNy9+WpE7ZOOuNh--