un-alias cpumask_any() from cpumask_first()
authorJan Beulich <jbeulich@suse.com>
Fri, 23 Aug 2013 13:01:53 +0000 (15:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Aug 2013 13:01:53 +0000 (15:01 +0200)
commit829b8498cc781f5ed8f7b9e16378f448b4d45213
treefa6057dc0bf1586818a82815a0fff3243a969f21
parent3829655bd3ad2b1150bd94955fc6988dec6b98f2
un-alias cpumask_any() from cpumask_first()

In order to achieve more symmetric distribution of certain things,
cpumask_any() shouldn't always pick the first CPU (which frequently
will end up being CPU0). To facilitate that, introduce a library-like
function to obtain random numbers.

The per-architecture function is supposed to return zero if no valid
random number can be obtained (implying that if occasionally zero got
produced as random number, it wouldn't be considered such).

As fallback this uses the trivial algorithm from the C standard,
extended to produce "unsigned int" results.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/Makefile
xen/common/random.c [new file with mode: 0644]
xen/include/asm-arm/percpu.h
xen/include/asm-arm/random.h [new file with mode: 0644]
xen/include/asm-x86/random.h [new file with mode: 0644]
xen/include/xen/cpumask.h
xen/include/xen/random.h [new file with mode: 0644]