]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - lib/bitmap.c
[PATCH] cpusets: bitmap and mask remap operators
authorPaul Jackson <pj@sgi.com>
Sun, 30 Oct 2005 23:02:33 +0000 (15:02 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:21 +0000 (17:37 -0800)
commitfb5eeeee44edb248b4837416966f19731f497f79
treef947a4dcf103f55d526bb5c71f69b657d8f22e61
parent28a42b9ea7e42e1efb02cc2dcacba0b6af234e1b
[PATCH] cpusets: bitmap and mask remap operators

In the forthcoming task migration support, a key calculation will be
mapping cpu and node numbers from the old set to the new set while
preserving cpuset-relative offset.

For example, if a task and its pages on nodes 8-11 are being migrated to
nodes 24-27, then pages on node 9 (the 2nd node in the old set) should be
moved to node 25 (the 2nd node in the new set.)

As with other bitmap operations, the proper way to code this is to provide
the underlying calculation in lib/bitmap.c, and then to provide the usual
cpumask and nodemask wrappers.

This patch provides that.  These operations are termed 'remap' operations.
Both remapping a single bit and a set of bits is supported.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/bitmap.h
include/linux/cpumask.h
include/linux/nodemask.h
lib/bitmap.c