Re: [PATCH] mm/mempolicy: refcount the weighted interleave state instead of copying it

From: Gregory Price

Date: Sun Aug 23 2026 - 23:53:10 EST


On Mon, Aug 24, 2026 at 04:06:03AM +0100, Matthew Wilcox wrote:
> On Sun, Aug 23, 2026 at 10:41:17PM -0400, Gregory Price wrote:
>
> Bit of a shame to take/put a refcount on every memory allocation. That
> seems like it might hurt (even being on a different cacheline). Would
> it make more sense to use SRCU for this?

Bulk allocation - from some measurements it's about once per 100-pages
on average. Looking back at the data I was getting about 41 refs per
4096 pages (16MB chunks).

Have to imagine there's other cache fighting in that stack too.

I'm less familiar with the rules around SRCU so i shied away from it,
but I will take a look.

~Gregory