···197static bool pcpu_chunk_page_occupied(struct pcpu_chunk *chunk,198 int page_idx)199{200- return *pcpu_chunk_pagep(chunk, 0, page_idx) != NULL;00000201}202203/* set the pointer to a chunk in a page struct */···302 return pcpu_first_chunk;303 }30400000000305 return pcpu_get_page_chunk(vmalloc_to_page(addr));306}307
···197static bool pcpu_chunk_page_occupied(struct pcpu_chunk *chunk,198 int page_idx)199{200+ /*201+ * Any possible cpu id can be used here, so there's no need to202+ * worry about preemption or cpu hotplug.203+ */204+ return *pcpu_chunk_pagep(chunk, raw_smp_processor_id(),205+ page_idx) != NULL;206}207208/* set the pointer to a chunk in a page struct */···297 return pcpu_first_chunk;298 }299300+ /*301+ * The address is relative to unit0 which might be unused and302+ * thus unmapped. Offset the address to the unit space of the303+ * current processor before looking it up in the vmalloc304+ * space. Note that any possible cpu id can be used here, so305+ * there's no need to worry about preemption or cpu hotplug.306+ */307+ addr += raw_smp_processor_id() * pcpu_unit_size;308 return pcpu_get_page_chunk(vmalloc_to_page(addr));309}310