percpu.c (e98bdb3059cbf2b1cd4261e126b08429f64466c3) | percpu.c (4091fb95b5f8dea37568d1a94c8227244bade891) |
---|---|
1/* 2 * mm/percpu.c - percpu memory allocator 3 * 4 * Copyright (C) 2009 SUSE Linux Products GmbH 5 * Copyright (C) 2009 Tejun Heo <tj@kernel.org> 6 * 7 * This file is released under the GPLv2. 8 * --- 29 unchanged lines hidden (view full) --- 38 * Allocation state in each chunk is kept using an array of integers 39 * on chunk->map. A positive value in the map represents a free 40 * region and negative allocated. Allocation inside a chunk is done 41 * by scanning this map sequentially and serving the first matching 42 * entry. This is mostly copied from the percpu_modalloc() allocator. 43 * Chunks can be determined from the address using the index field 44 * in the page struct. The index field contains a pointer to the chunk. 45 * | 1/* 2 * mm/percpu.c - percpu memory allocator 3 * 4 * Copyright (C) 2009 SUSE Linux Products GmbH 5 * Copyright (C) 2009 Tejun Heo <tj@kernel.org> 6 * 7 * This file is released under the GPLv2. 8 * --- 29 unchanged lines hidden (view full) --- 38 * Allocation state in each chunk is kept using an array of integers 39 * on chunk->map. A positive value in the map represents a free 40 * region and negative allocated. Allocation inside a chunk is done 41 * by scanning this map sequentially and serving the first matching 42 * entry. This is mostly copied from the percpu_modalloc() allocator. 43 * Chunks can be determined from the address using the index field 44 * in the page struct. The index field contains a pointer to the chunk. 45 * |
46 * To use this allocator, arch code should do the followings. | 46 * To use this allocator, arch code should do the following: |
47 * 48 * - define __addr_to_pcpu_ptr() and __pcpu_ptr_to_addr() to translate 49 * regular address to percpu pointer and back if they need to be 50 * different from the default 51 * 52 * - use pcpu_setup_first_chunk() during percpu area initialization to 53 * setup the first chunk containing the kernel static percpu area 54 */ --- 2263 unchanged lines hidden --- | 47 * 48 * - define __addr_to_pcpu_ptr() and __pcpu_ptr_to_addr() to translate 49 * regular address to percpu pointer and back if they need to be 50 * different from the default 51 * 52 * - use pcpu_setup_first_chunk() during percpu area initialization to 53 * setup the first chunk containing the kernel static percpu area 54 */ --- 2263 unchanged lines hidden --- |