]> git.baikalelectronics.ru Git - kernel.git/commit
cpumask: Utility function to set n'th cpu - local cpu first
authorAmir Vadai <amirv@mellanox.com>
Sun, 25 May 2014 14:47:26 +0000 (17:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Jun 2014 02:16:29 +0000 (19:16 -0700)
commit276447ba635b6ce7fa75520b4acafea9d2a7a014
treefef93ad82529c709aeb8d15fb4330631918698d9
parenta7c9c82a84e857bd719c206a674833cbdd4cac07
cpumask: Utility function to set n'th cpu - local cpu first

This function sets the n'th cpu - local cpu's first.
For example: in a 16 cores server with even cpu's local, will get the
following values:
cpumask_set_cpu_local_first(0, numa, cpumask) => cpu 0 is set
cpumask_set_cpu_local_first(1, numa, cpumask) => cpu 2 is set
...
cpumask_set_cpu_local_first(7, numa, cpumask) => cpu 14 is set
cpumask_set_cpu_local_first(8, numa, cpumask) => cpu 1 is set
cpumask_set_cpu_local_first(9, numa, cpumask) => cpu 3 is set
...
cpumask_set_cpu_local_first(15, numa, cpumask) => cpu 15 is set

Curently this function will be used by multi queue networking devices to
calculate the irq affinity mask, such that as many local cpu's as
possible will be utilized to handle the mq device irq's.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/cpumask.h
lib/cpumask.c