Skip to content

Commit b3b33d3

Browse files
mcsmonkdennisszhou
authored andcommitted
percpu: fix first chunk size calculation for populated bitmap
Variable populated, which is a member of struct pcpu_chunk, is used as a unit of size of unsigned long. However, size of populated is miscounted. So, I fix this minor part. Fixes: 8ab16c4 ("percpu: change the number of pages marked in the first_chunk pop bitmap") Cc: <[email protected]> # 4.14+ Signed-off-by: Sunghyun Jin <[email protected]> Signed-off-by: Dennis Zhou <[email protected]>
1 parent f75aef3 commit b3b33d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/percpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
13161316

13171317
/* allocate chunk */
13181318
alloc_size = sizeof(struct pcpu_chunk) +
1319-
BITS_TO_LONGS(region_size >> PAGE_SHIFT);
1319+
BITS_TO_LONGS(region_size >> PAGE_SHIFT) * sizeof(unsigned long);
13201320
chunk = memblock_alloc(alloc_size, SMP_CACHE_BYTES);
13211321
if (!chunk)
13221322
panic("%s: Failed to allocate %zu bytes\n", __func__,

0 commit comments

Comments
 (0)