• Michael Anthony Knyszek's avatar
    runtime: ensure free and unscavenged spans may be backed by huge pages · 31c4e099
    Michael Anthony Knyszek authored
    This change adds a new sysHugePage function to provide the equivalent of
    Linux's madvise(MADV_HUGEPAGE) support to the runtime. It then uses
    sysHugePage to mark a newly-coalesced free span as backable by huge
    pages to make the freeHugePages approximation a bit more accurate.
    
    The problem being solved here is that if a large free span is composed
    of many small spans which were coalesced together, then there's a chance
    that they have had madvise(MADV_NOHUGEPAGE) called on them at some point,
    which makes freeHugePages less accurate.
    
    For #30333.
    
    Change-Id: Idd4b02567619fc8d45647d9abd18da42f96f0522
    Reviewed-on: https://go-review.googlesource.com/c/go/+/173338
    Run-TryBot: Michael Knyszek <mknyszek@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    31c4e099