I recently had the need to allocate memory on a specific node. If that
node doesn't have memory of the exact type I want, I want the allocation
to fail. Matt Dobson has a much more robust and flexible one, but you
just can't beat this one's simplicity. It's not even ifdef'd for NUMA.
pfn_to_nid(*) != numa_node_id() will always be false for non-NUMA
systems, so the compiler should eliminate that if() completely.
I'll have users for it soon, I promise.
Get latest updates about Open Source Projects, Conferences and News.