30 #if defined(CONFIG_SMP) && defined(CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK)
31 #error "contiguous percpu allocation is incompatible with paged first chunk"
41 memset((
void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size);
46 static
void pcpu_depopulate_chunk(
struct pcpu_chunk *chunk,
int off,
int size)
51 static struct pcpu_chunk *pcpu_create_chunk(
void)
53 const int nr_pages = pcpu_group_sizes[0] >>
PAGE_SHIFT;
58 chunk = pcpu_alloc_chunk();
64 pcpu_free_chunk(chunk);
68 for (i = 0; i < nr_pages; i++)
69 pcpu_set_page_chunk(nth_page(pages, i), chunk);
76 static void pcpu_destroy_chunk(
struct pcpu_chunk *chunk)
78 const int nr_pages = pcpu_group_sizes[0] >>
PAGE_SHIFT;
80 if (chunk && chunk->
data)
82 pcpu_free_chunk(chunk);
85 static struct page *pcpu_addr_to_page(
void *
addr)
103 if (alloc_pages > nr_pages)
105 alloc_pages - nr_pages);