Re: [PATCH 05/10] percpu: change reserved_size to end page aligned

From: Dennis Zhou
Date: Mon Jul 24 2017 - 16:07:08 EST


Hi Tejun,

On Mon, Jul 17, 2017 at 12:46:50PM -0400, Tejun Heo wrote:

> Heh, that was pretty difficult to parse, but here's my question. So,
> we're expanding reserved area so that its end aligns to page boundary
> which is completely fine. We may end up with reserved area which is a
> bit larger than specified but no big deal. However, we can't do the
> same thing with the boundary between the static and reserved chunks,
> so instead we pull down the start of the reserved area and mark off
> the overwrapping area, which is fine too.
>
> My question is why we're doing one thing for the end of reserved area
> while we need to do a different thing for the beginning of it. Can't
> we do the same thing in both cases? ie. for the both boundaries
> between static and reserved, and reserved and dynamic, pull down the
> start to the page boundary and mark the overlapping areas used?

I've refactored the code to maintain start and end offsets. This removes
the need to expand the reserved region. There are a few more constraints
though. The reserved region must be a multiple of the minimum allocation
size. The static region and dynamic region are expanded and shrunk
respectively to maintain alignment with the minimum allocation size.

Thanks,
Dennis