Greetingz!
What you're looking for is called "CPU Afinity". It's been around since 2.5.x, so there are
several articles discussing how to implement it. You can also check the
taskset man page.
On a side note, if you have a BIOS option to set your RAM to
NUMA mode (rather than some other mode), then you seem to get better affinity. (As suggested
here,
here, and
even here.)
EDIT: Note that if you have a multi-core CPU, you would be binding per-core, not per-socket (CPU).