Skip to content

Conversation

@fslongjin
Copy link
Member

  • 修复madvise长度参数未对齐时的处理逻辑,添加长度向上舍入和溢出检查
  • 优化msync系统调用中的VMA查找逻辑,修复锁竞争和边界条件问题
  • 修复UserMappings::find_nearest中的VMA查找逻辑错误
  • 启用madvise测试

@fslongjin fslongjin requested review from Copilot and sparkzky November 6, 2025 07:50
@github-actions github-actions bot added the Bug fix A bug is fixed in this pull request label Nov 6, 2025
Copy link
Contributor

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 pull request adds support for the madvise system call and fixes critical bugs in VMA (Virtual Memory Area) traversal logic. The changes improve memory management functionality and resolve issues related to memory mapping operations.

  • Enables madvise_test in the test whitelist with specific blocked test cases
  • Fixes the find_nearest VMA search logic to correctly find the next VMA after a given address
  • Refactors sys_msync to release locks before calling find_nearest, preventing potential deadlocks
  • Updates sys_madvise to properly handle unaligned length parameters and overflow conditions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
user/apps/tests/syscall/gvisor/whitelist.txt Adds madvise_test to the test suite
user/apps/tests/syscall/gvisor/blocklists/madvise_test Defines blocked test cases for madvise (DontforkShared and DontforkAnonPrivate)
user/apps/tests/syscall/gvisor/blocklists/fork_test Adds detailed comments explaining glibc error with COWSegment test
kernel/src/mm/ucontext.rs Fixes find_nearest logic to search forward instead of backward
kernel/src/mm/syscall/sys_msync.rs Refactors to release VMA lock before calling find_nearest, preventing deadlock
kernel/src/mm/syscall/sys_madvise.rs Updates to handle unaligned length with proper overflow checking

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

- 修复madvise长度参数未对齐时的处理逻辑,添加长度向上舍入和溢出检查
- 优化msync系统调用中的VMA查找逻辑,修复锁竞争和边界条件问题
- 修复UserMappings::find_nearest中的VMA查找逻辑错误
- 启用madvise测试

Signed-off-by: longjin <longjin@DragonOS.org>
@fslongjin fslongjin merged commit d72261e into DragonOS-Community:master Nov 6, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug fix A bug is fixed in this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant