Skip to content

Commit

Permalink
percpu: fix a comment about the chunks ordering
Browse files Browse the repository at this point in the history
Since the commit 3e54097 ("percpu: manage chunks based on
contig_bits instead of free_bytes") chunks are sorted based on the
size of the biggest continuous free area instead of the total number
of free bytes. Update the corresponding comment to reflect this.

Signed-off-by: Roman Gushchin <[email protected]>
Signed-off-by: Dennis Zhou <[email protected]>
  • Loading branch information
rgushchin authored and dennisszhou committed Apr 16, 2021
1 parent d434405 commit ac9380f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@

#include "percpu-internal.h"

/* the slots are sorted by free bytes left, 1-31 bytes share the same slot */
/*
* The slots are sorted by the size of the biggest continuous free area.
* 1-31 bytes share the same slot.
*/
#define PCPU_SLOT_BASE_SHIFT 5
/* chunks in slots below this are subject to being sidelined on failed alloc */
#define PCPU_SLOT_FAIL_THRESHOLD 3
Expand Down

0 comments on commit ac9380f

Please sign in to comment.