diff options
author | Dave Young <dyoung@redhat.com> | 2011-11-23 11:20:53 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-11-23 11:20:53 -0500 |
commit | 67589c71456b0346500629967292dea3802230b6 (patch) | |
tree | 2fdbe50888cc77b740862c0f6f182082a4aeeab9 /mm/percpu.c | |
parent | a855b84c3d8c73220d4d3cd392a7bee7c83de70e (diff) |
percpu: explain why per_cpu_ptr_to_phys() is more complicated than necessary
Add comments about current per_cpu_ptr_to_phys implementation to
explain why the logic is more complicated than necessary.
-tj: relocated comment into kerneldoc comment
Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu.c')
-rw-r--r-- | mm/percpu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 2473ff06dc76..3bb810a72006 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -978,6 +978,17 @@ bool is_kernel_percpu_address(unsigned long addr) | |||
978 | * address. The caller is responsible for ensuring @addr stays valid | 978 | * address. The caller is responsible for ensuring @addr stays valid |
979 | * until this function finishes. | 979 | * until this function finishes. |
980 | * | 980 | * |
981 | * percpu allocator has special setup for the first chunk, which currently | ||
982 | * supports either embedding in linear address space or vmalloc mapping, | ||
983 | * and, from the second one, the backing allocator (currently either vm or | ||
984 | * km) provides translation. | ||
985 | * | ||
986 | * The addr can be tranlated simply without checking if it falls into the | ||
987 | * first chunk. But the current code reflects better how percpu allocator | ||
988 | * actually works, and the verification can discover both bugs in percpu | ||
989 | * allocator itself and per_cpu_ptr_to_phys() callers. So we keep current | ||
990 | * code. | ||
991 | * | ||
981 | * RETURNS: | 992 | * RETURNS: |
982 | * The physical address for @addr. | 993 | * The physical address for @addr. |
983 | */ | 994 | */ |