percpu: make pcpu_block_md generic

In reality, a chunk is just a block covering a larger number of bits.
The hints themselves are one in the same. Rather than maintaining the
hints separately, first introduce nr_bits to genericize
pcpu_block_update() to correctly maintain block->right_free. The next
patch will convert chunk hints to be managed as a pcpu_block_md.

Signed-off-by: Dennis Zhou <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
This commit is contained in:
Dennis Zhou 2019-02-26 09:56:16 -08:00
commit 047924c968
2 changed files with 14 additions and 7 deletions

View file

@ -28,6 +28,7 @@ struct pcpu_block_md {
int right_free; /* size of free space along
the right side of the block */
int first_free; /* block position of first free */
int nr_bits; /* total bits responsible for */
};
struct pcpu_chunk {