On Tue, Jan 24, 2023 at 02:40:54PM +0100, Vlastimil Babka wrote: > > > On January 24, 2023 12:16:20 PM GMT+01:00, Mike Rapoport <rppt@xxxxxxxxxx> wrote: > >On Tue, Jan 24, 2023 at 12:00:07PM +0100, Vlastimil Babka wrote: > >> On 1/15/23 19:42, Mike Rapoport wrote: > >> > From: "Mike Rapoport (IBM)" <rppt@xxxxxxxxxx> > >> > > >> > Add structure, introduction and Nodes section to Physical Memory > >> > chapter. > >> > > >> > As the new documentation references core-api/dma-api and mm/page_reclaim, > >> > add page labels to those documents. > >> > > >> > Reviewed-by: Bagas Sanjaya <bagasdotme@xxxxxxxxx> > >> > Reviewed-by: Lorenzo Stoakes <lstoakes@xxxxxxxxx> > >> > Acked-by: Michal Hocko <mhocko@xxxxxxxx> > >> > Signed-off-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> > >> > >> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> > >> > >> A small bug to fix below? > >> > >> <snip> > >> > >> > + > >> > +Along with the node structures, kernel maintains an array of ``nodemask_t`` > >> > +bitmasks called ``node_states``. Each bitmask in this array represents a set of > >> > +nodes with particular properties as defined by ``enum node_states``: > >> > + > >> > +``N_POSSIBLE`` > >> > + The node could become online at some point. > >> > +``N_ONLINE`` > >> > + The node is online. > >> > +``N_NORMAL_MEMORY`` > >> > + The node has regular memory. > >> > +``N_HIGH_MEMORY`` > >> > + The node has regular or high memory. When ``CONFIG_HIGHMEM`` is disabled > >> > + aliased to ``N_NORMAL_MEMORY``. > >> > >> Noted. > >> > >> > +``N_MEMORY`` > >> > + The node has memory(regular, high, movable) > >> > +``N_CPU`` > >> > + The node has one or more CPUs > >> > + > >> > +For each node that has a property described above, the bit corresponding to the > >> > +node ID in the ``node_states[<property>]`` bitmask is set. > >> > + > >> > +For example, for node 2 with normal memory and CPUs, bit 2 will be set in :: > >> > + > >> > + node_states[N_POSSIBLE] > >> > + node_states[N_ONLINE] > >> > + node_states[N_NORMAL_MEMORY] > >> > + node_states[N_MEMORY] > >> > + node_states[N_CPU] > >> > >> Should it be set also in node_states[N_HIGH_MEMORY]? > > > >You mean because of the aliasing of N_NORMAL_MEMORY and N_HIGH_MEMORY? > > No I meant due to "The node has regular or high memory." Or do I misunderstand? I checked the code, node_states[N_HIGH_MEMORY] will be set indeed. Will send v5 soon.