RLIMIT_CPU charges a VM-clone child's CPU time to its parent

Đang mở
#478 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, linux
Lĩnh vực
operating-systems

Hướng nghiên cứu

Start by reading src/runtime/forkipc.c around sys_clone_vm and src/syscall/sys.c around rlimit_cpu_main to see how VM-clone children are tracked and how CLOCK_PROCESS_CPUTIME_ID is sampled. Inspect test-rlimit-cpu for the existing limit tests, then add the described parent/child case so each guest process accounts for its own vCPU threads and the parent avoids SIGXCPU.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

A clone(CLONE_VM) child without CLONE_THREAD or CLONE_VFORK runs inside its parent's host process (sys_clone_vm in src/runtime/forkipc.c). The RLIMIT_CPU sampler from #475 (rlimit_cpu_main in src/syscall/sys.c) reads CLOCK_PROCESS_CPUTIME_ID, which counts the whole host process, so the parent and every VM-clone child share one CPU clock and one limit.

On Linux these are separate processes, each with its own CPU time and its own RLIMIT_CPU. Under elfuse, a parent whose VM-clone child spins gets SIGXCPU or SIGKILL for CPU time the child spent. signal_queue_info also puts the signal in the shared pending set, where the child's vCPU can dequeue it.

Follow-ups

  • Account CPU time per guest process, summing the vCPU threads of each one, and give each VM-clone child its own RLIMIT_CPU check.
  • Add a case to test-rlimit-cpu: a parent under a soft limit of 1 s sleeps while a CLONE_VM child spins for 2 s, and the parent gets no SIGXCPU.
Ngôn ngữ chính
C
Star
278
Fork
31
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sysprog21/elfuse

Tất cả issue của sysprog21/elfuse

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.