Skip to content

feat(mem): add KernelStack field for ExVirtualMemory on linux#1986

Merged
shirou merged 2 commits intomasterfrom
feat/mem_kernel_stack
Jan 4, 2026
Merged

feat(mem): add KernelStack field for ExVirtualMemory on linux#1986
shirou merged 2 commits intomasterfrom
feat/mem_kernel_stack

Conversation

@shirou
Copy link
Copy Markdown
Owner

@shirou shirou commented Dec 31, 2025

This is a PR under #1884. But this PR moves KernelStack field to ExVirtualMemory because that is Linux only .

@shirou shirou changed the title move KernelStack to ExVirtualMemory struct feat(mem): add KernelStack field for ExVirtualMemory on linux Dec 31, 2025
@shirou shirou requested a review from Copilot December 31, 2025 04:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the KernelStack field to both the VirtualMemoryStat struct and the Linux-specific ExVirtualMemory struct. This field was previously missing but is available in Linux's /proc/meminfo. The change ensures that kernel stack memory usage is captured and exposed through both the general and extended memory statistics APIs on Linux.

Key Changes:

  • Added KernelStack field to VirtualMemoryStat struct with camelCase JSON tag
  • Added KernelStack field to Linux-specific ExVirtualMemory struct
  • Updated Linux parsing logic to populate both KernelStack fields from /proc/meminfo

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
mem/mem.go Added KernelStack field to VirtualMemoryStat struct between Sunreclaim and PageTables
mem/ex_linux.go Added KernelStack field to Linux-specific ExVirtualMemory struct
mem/mem_linux.go Added parsing logic for KernelStack from /proc/meminfo, populating both main and extended memory stats
mem/mem_test.go Updated expected JSON string in test to include kernelStack field
mem/mem_linux_test.go Added KernelStack values to test cases where the field is present in corresponding test data files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mem/ex_linux.go Outdated
@shirou shirou force-pushed the feat/mem_kernel_stack branch from dc33c11 to c6f4d8b Compare December 31, 2025 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants