Re: [PATCH RFC v6 06/18] fs/resctrl: Let bandwidth resources default to min_bw at reset

From: Drew Fustini

Date: Mon Jun 01 2026 - 21:12:30 EST


On Mon, Jun 01, 2026 at 08:55:17PM +0000, sashiko-bot@xxxxxxxxxx wrote:
> > @@ -405,7 +412,7 @@ static inline u32 resctrl_get_default_ctrl(struct rdt_resource *r)
> > case RESCTRL_SCHEMA_BITMAP:
> > return BIT_MASK(r->cache.cbm_len) - 1;
> [Severity: High]
> This is a pre-existing issue, but does the use of BIT_MASK cause an incorrect
> default mask to be generated on 32-bit architectures?
>
> If a system has a maximum cache bitmask length of 32, which is
> architecturally allowed by the Intel CAT specification, BITS_PER_LONG is 32
> on 32-bit systems. The BIT_MASK macro evaluates to
> (1UL << ((nr) % BITS_PER_LONG)).
>
> For a cbm_len of 32, 32 % 32 evaluates to 0, which makes BIT_MASK(32) equal
> to 1. Subtracting 1 results in a default cache allocation mask of 0 instead
> of the expected 0xFFFFFFFF. Could this functionally break the cache
> allocation mechanism by starving groups of L3/L2 cache on group creation
> and reset?
>
> > case RESCTRL_SCHEMA_RANGE:
> > - return r->membw.max_bw;
> > + return r->membw.default_to_min ? r->membw.min_bw : r->membw.max_bw;

That is irrelevant for this patch as it does not touch RESCTRL_SCHEMA_BITMAP.

Drew