Re: [Lse-tech] New version of simple-binding NUMA API on sourceforge...

> > Interesting! Usually, the hardware numbers CPUs within a NUMA
domain/node,
> > and often has large non-integer IDs for the nodes themselves. So the
> > OS has considerable freedom on assigning numbers.
> >
> > The current numalock algorithm relies on the ability to quickly map
> > CPUs into bits in a long. It also relies on a given node's CPU numbers
> > not being interleaved with numbers from some other CPU. There are
> > NUMA-aware locking algorithms that do not require this sort of mapping,
> > but these algorithms are -much- more complex (more than 1,000 lines of
> > code), and slower, too.
>
> So long as we know the maximum number of cpus in a NUMA domain it should
> be OK. The architecture code could map NUMA domain identifiers into some
> sort of logical order and we just allocate the maximum number of cpus
> per domain. That means we never get interleaving of cpus and it makes
> our life easier trying to map linux cpus back to the hardware when the
> cpu plays up :)
Sounds great! Sure would be nice if the hardware/firmware helps
with the maximum number of CPUs per domain. ;-)
> > The NUMA-aware algorithm -can- handle "gaps" in the CPU numbering,
> > so if the CPUs can still be mapped to small integers, and if "gaps"
> > are left to allow for any additional CPUs that could be plugged into
> > a node, we should be OK, right?
>
> Yep sounds good.
Great!
> > I may be missing something, but doesn't
> > the hotplug patch work with the existing code in the kernel that
> > maintains arrays with per-CPU elements and that maintains bitmasks
> > with per-CPU bits? If so, the same sort of thing should work here,
> > right?
>
> Well the old for(i = 0; i < smp_num_cpus; i++) has been replaced with
> a for_each_cpu() macro. I dont think Rusty removed the reliance on
> unsigned long cpu bitmasks, but it wouldnt be much more work on top
> of the hotplug cpu patch, I had planned to test it a while ago.
Interesting! What sorts of things were the unsigned long CPU bitmasks
to be replaced with?
Thanx, Paul