summaryrefslogtreecommitdiffstats
path: root/include/linux/percpu.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-07-04 08:11:00 +0900
committerTejun Heo <tj@kernel.org>2009-07-04 08:11:00 +0900
commit2f39e637ea240efb74cf807d31c93a71a0b89174 (patch)
treed26bd3ad962031c5b495a528b4115c2ed4ff7a80 /include/linux/percpu.h
parentce3141a277ff6cc37e51008b8888dc2cb7456ef1 (diff)
downloadop-kernel-dev-2f39e637ea240efb74cf807d31c93a71a0b89174.zip
op-kernel-dev-2f39e637ea240efb74cf807d31c93a71a0b89174.tar.gz
percpu: allow non-linear / sparse cpu -> unit mapping
Currently cpu and unit are always identity mapped. To allow more efficient large page support on NUMA and lazy allocation for possible but offline cpus, cpu -> unit mapping needs to be non-linear and/or sparse. This can be easily implemented by adding a cpu -> unit mapping array and using it whenever looking up the matching unit for a cpu. The only unusal conversion is in pcpu_chunk_addr_search(). The passed in address is unit0 based and unit0 might not be in use so it needs to be converted to address of an in-use unit. This is easily done by adding the unit offset for the current processor. [ Impact: allows non-linear/sparse cpu -> unit mapping, no visible change yet ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/percpu.h')
-rw-r--r--include/linux/percpu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 63c8b7a..1e0e887 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -57,6 +57,7 @@
#endif
extern void *pcpu_base_addr;
+extern const int *pcpu_unit_map;
typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size);
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
@@ -66,7 +67,7 @@ typedef void (*pcpu_fc_map_fn_t)(void *ptr, size_t size, void *addr);
extern size_t __init pcpu_setup_first_chunk(
size_t static_size, size_t reserved_size,
ssize_t dyn_size, size_t unit_size,
- void *base_addr);
+ void *base_addr, const int *unit_map);
extern ssize_t __init pcpu_embed_first_chunk(
size_t static_size, size_t reserved_size,
OpenPOWER on IntegriCloud