Skip to content

Commit

Permalink
percpu: update free path with correct new free region
Browse files Browse the repository at this point in the history
When updating the chunk's contig_hint on the free path of a hint that
does not touch the page boundaries, it was incorrectly using the
starting offset of the free region and the block's contig_hint. This
could lead to incorrect assumptions about fit given a size and better
alignment of the start. Fix this by using (end - start) as this is only
called when updating a hint within a block.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
  • Loading branch information
dennisszhou committed Mar 13, 2019
1 parent fa3d493 commit 8e5a2b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
pcpu_chunk_refresh_hint(chunk);
else
pcpu_chunk_update(chunk, pcpu_block_off_to_off(s_index, start),
s_block->contig_hint);
end - start);
}

/**
Expand Down

0 comments on commit 8e5a2b9

Please sign in to comment.