[PATCH RFC v2 09/54] x86/mm/pat: separate CPA request flags from internal state

Rik van Riel riel at surriel.com
Thu Dec 3 11:21:53 PST 2026


On Thu, 2026-11-26 at 13:14 +0200, Mike Rapoport (Microsoft) wrote:
> struct cpa_data has a mixture of flags stored in the flags field and
> in
> several bitfields, such as .force_split and .force_flush_all.
> 
> The use of plain flags and bitfields for caller-requested behaviour
> and
> internal state management is inconsistent: .force_split is a caller
> request, while the other bitfields are managed internally by CPA
> functions.
> 
> The same is true for CPA_ flags: CPA_FLUSHTLB is set internally when
> a TLB
> flush is required, while the other flags express the desired
> behaviour.
> 
> Keep caller requests in cpa_data.flags and move internal bookkeeping
> to
> cpa_data.state. Replace the bitfields with CPA_ flags.
> 
They could probably be a smaller data type and get
packed into the same unsigned long, but for cpa_data
it really doesn't matter, so ...

> No functional change intended.
> 
> Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> 
Reviewed-by: Rik van Riel <riel at surriel.com>


-- 
All Rights Reversed.



More information about the linux-arm-kernel mailing list