[Bug 274316] excessive memory consumed by static_single_cpu_mask

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 06 Oct 2023 21:32:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274316

            Bug ID: 274316
           Summary: excessive memory consumed by static_single_cpu_mask
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: emaste@freebsd.org

in sys/compat/linuxkpi/common/src/linux_compat.c we have:
static cpumask_t static_single_cpu_mask[MAXCPU];

cpumask_t *
lkpi_get_static_single_cpu_mask(int cpuid)
{

        KASSERT((cpuid >= 0 && cpuid < MAXCPU), ("%s: invalid cpuid %d\n",
            __func__, cpuid));

        return (&static_single_cpu_mask[cpuid]);
}

when testing (an admittedly excessive) MAXCPU=65536 this array is huge (as
cpumask_t also scales with MAXCPU). on arm64 andrew found it is responsible for
512M of .bss's 566M.

-- 
You are receiving this mail because:
You are the assignee for the bug.