Commit e04cb697 authored by Baoquan He's avatar Baoquan He Committed by Dennis Zhou
Browse files

mm/percpu: Update the code comment when creating new chunk



The lock pcpu_alloc_mutex taking code has been moved to the beginning of
pcpu_allo() if it's non atomic allocation. So the code comment above
above pcpu_create_chunk() callsite need be updated.

Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
parent c1f6688d
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1817,16 +1817,12 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,

	spin_unlock_irqrestore(&pcpu_lock, flags);

	/*
	 * No space left.  Create a new chunk.  We don't want multiple
	 * tasks to create chunks simultaneously.  Serialize and create iff
	 * there's still no empty chunk after grabbing the mutex.
	 */
	if (is_atomic) {
		err = "atomic alloc failed, no space left";
		goto fail;
	}

	/* No space left.  Create a new chunk. */
	if (list_empty(&pcpu_chunk_lists[pcpu_free_slot])) {
		chunk = pcpu_create_chunk(pcpu_gfp);
		if (!chunk) {