[PATCH v1 0/5] MM_CID and HPCC mm_struct static init fixes

Mathieu Desnoyers posted 5 patches 1 month, 2 weeks ago
drivers/firmware/efi/efi.c          |  2 +-
include/linux/mm.h                  |  2 +-
include/linux/mm_types.h            | 18 +++++++---
include/linux/percpu_counter_tree.h | 51 +++++++++++++++++++++++++++++
kernel/tsacct.c                     |  2 +-
mm/init-mm.c                        |  5 ++-
6 files changed, 71 insertions(+), 9 deletions(-)
[PATCH v1 0/5] MM_CID and HPCC mm_struct static init fixes
Posted by Mathieu Desnoyers 1 month, 2 weeks ago
Hi Andrew,

Mark Brown reported a regression [1] on linux next due to the
hierarchical percpu counters (HPCC). You mentioned they were only in
mm-new (and therefore not pulled into -next) [2], but it looks like they
got more exposure that we expected. :)

This bug hunting got me to fix static initialization issues in both
MM_CID (for upstream) and HPCC (mm-new). Mark tested my series and
confirmed that it fixes his issues.

Please consider the HPCC fixes for mm-new, and the MM_CID fixes for
upstream.

This series is based on mm-new
commit 287373d0b6ee ("selftests/mm: fix comment for check_test_requirements")

Thanks,

Mathieu

Link: https://lore.kernel.org/lkml/c8acf650-ef96-4449-ba85-557dedba0ffc@sirena.org.uk/ # [1]
Link: https://lore.kernel.org/lkml/20251122111336.56b060c86ff6ba41fe76bfd4@linux-foundation.org/ [2]
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-mm@kvack.org

Mathieu Desnoyers (5):
  mm: Add missing static initializer for init_mm::mm_cid.lock
  mm: Rename cpu_bitmap field to flexible_array
  mm: Take into account mm_cid size for mm_struct static definitions
  mm: Take into account hierarchical percpu tree items for static
    mm_struct definitions
  tsacct: Skip all kernel threads

 drivers/firmware/efi/efi.c          |  2 +-
 include/linux/mm.h                  |  2 +-
 include/linux/mm_types.h            | 18 +++++++---
 include/linux/percpu_counter_tree.h | 51 +++++++++++++++++++++++++++++
 kernel/tsacct.c                     |  2 +-
 mm/init-mm.c                        |  5 ++-
 6 files changed, 71 insertions(+), 9 deletions(-)

-- 
2.39.5
Re: [PATCH v1 0/5] MM_CID and HPCC mm_struct static init fixes
Posted by Andrew Morton 1 month, 2 weeks ago
On Sun, 21 Dec 2025 18:29:21 -0500 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> Mark Brown reported a regression [1] on linux next due to the
> hierarchical percpu counters (HPCC). You mentioned they were only in
> mm-new (and therefore not pulled into -next) [2], but it looks like they
> got more exposure that we expected. :)

We try to please ;)

Mark's report is why this series remains in mm-new and didn't get
promoted to mm-unstable (and hence linux-next).

Also, I anticipate a new version of this series thanks to
https://lkml.kernel.org/r/2fb78e41-5e56-425f-925f-a29524355d2c@efficios.com

> This bug hunting got me to fix static initialization issues in both
> MM_CID (for upstream) and HPCC (mm-new). Mark tested my series and
> confirmed that it fixes his issues.
> 
> Please consider the HPCC fixes for mm-new, and the MM_CID fixes for
> upstream.
> 
> This series is based on mm-new
> commit 287373d0b6ee ("selftests/mm: fix comment for check_test_requirements")

Well, simply appending this series to your "mm: Fix OOM killer
inaccuracy on large many-core systems, v10" will create an annoying
bisection hole.

Also, there are some cc:stable fixes in here which depend upon the
presence of "mm: Fix OOM killer inaccuracy on large many-core systems"
series, which is all backwards.


So for now I'll toss this series in there for testing but I'll ask for
a redo, please.

- All cc:stable patches prepared in a standalone fashion against
  latest mainline.

- Any non-cc:stable patches which fix things in current mm-new come
  next.  Perhaps view these as preparation for "mm: Fix OOM killer
  inaccuracy on large many-core systems".

- Then "mm: Fix OOM killer inaccuracy on large many-core systems,
  v11" which incorporates anything which didn't make it into the above
  two categories.

That could be as many as three patch series. Thanks.
Re: [PATCH v1 0/5] MM_CID and HPCC mm_struct static init fixes
Posted by Mathieu Desnoyers 1 month, 2 weeks ago
On 2025-12-22 20:59, Andrew Morton wrote:
[...]
> Well, simply appending this series to your "mm: Fix OOM killer
> inaccuracy on large many-core systems, v10" will create an annoying
> bisection hole.
> 
> Also, there are some cc:stable fixes in here which depend upon the
> presence of "mm: Fix OOM killer inaccuracy on large many-core systems"
> series, which is all backwards.
> 
> 
> So for now I'll toss this series in there for testing but I'll ask for
> a redo, please.
> 
> - All cc:stable patches prepared in a standalone fashion against
>    latest mainline.
> 
> - Any non-cc:stable patches which fix things in current mm-new come
>    next.  Perhaps view these as preparation for "mm: Fix OOM killer
>    inaccuracy on large many-core systems".
> 
> - Then "mm: Fix OOM killer inaccuracy on large many-core systems,
>    v11" which incorporates anything which didn't make it into the above
>    two categories.
> 
> That could be as many as three patch series. Thanks.

Will do! It may take a few days due to holiday vacations here.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com