Prerequisites

Since the majority of systems have just one memory node, only systems of this type are examined below. What is the situation on such systems? To ensure that memory management code is portable (so that it can be used on UMA and NUMA systems alike), the kernel defines a single instance of pg_data_t (called contig_page_data) in mm/page_alloc.c to manage all system memory. As the file pathname suggests, this is not a CPU-specific implementation; in fact, it is adopted by most architectures. The implementation of NODE_DATA is now even simpler.

#define NODE_DATA(nid) (&contig_page_data)

Although the macro has a formal parameter for selecting a NUMA node, the same data are always returned — there is just one pseudo-node.

The kernel can also rely on the fact that the architecture-dependent initialization code has set the numnodes variable to the number of nodes present in the system. This number is 1 on UMA systems because only one (formal) node is present.

At compilation time, pre-processor statements select the correct definitions for the particular configuration.

Continue reading here: System Start

Was this article helpful?

0 0