On Thu, 2024-07-11 at 11:51 +0530, Gk Gk wrote:
How does the scheduler check the numa nodes availability in the background ? Does it use any db like placement to calculate the allocation, resource etc for numa ? I need just the logic in the scheduler for this check ?
yes this exists it is codeifed in the numa toplogy filter https://github.com/openstack/nova/blob/master/nova/scheduler/filters/numa_to... that uses code stroed in https://github.com/openstack/nova/blob/master/nova/virt/hardware.py which is shared with the compute agent. the scheduelr filter filters out host were the requested numa toplogy cannot fit the allocation of resocues only happen on the compute node after scheduling as part of the instace_claim process. both the compute agent and scheduler use use data stored in the compute node table of the cell databse to calulate the numa affinity constraints and determin how to allocate the resouces and if it will fit. numa is not tracked in placment so it possibel for two seperate request to race fro the final resouces on a compute node as placment just ensures enouch cpus, ram and disk exist not that they exist on the correct numa nodes. the following blog posts form stephen are a good starting poitn to deep dive into some of how that works https://that.guru/blog/the-numa-scheduling-story-in-nova/ https://that.guru/blog/cpu-resources/ https://that.guru/blog/cpu-resources-redux/ but we aslo have nova docs https://docs.openstack.org/nova/latest/admin/cpu-topologies.html#customizing... https://docs.openstack.org/nova/latest/admin/flavors.html#extra-specs-numa-t... https://docs.openstack.org/nova/latest/admin/huge-pages.html and design specs that cover this in detail https://specs.openstack.org/openstack/nova-specs/specs/train/implemented/num... https://specs.openstack.org/openstack/nova-specs/specs/train/implemented/cpu... including how we would do this in placement if we ever had the time https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/numa-... older specs exist form when this was first added to nova 8-9 years ago but you can largely ignore those.
Thanks Y.G