-
-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Procfs enhancements #1066
base: master
Are you sure you want to change the base?
Procfs enhancements #1066
Conversation
d45c092
to
92abce3
Compare
Hello @tbodt! Asking you to review these changes, they make The patches can collect statistics on which tasks are blocked. This is done using a special wrapper in zones which can block our code (e.g calling real's os syscall). The wrapper is implemented with |
Seems it closes #273 |
The func returns a count of vcpus
Thanks for the PR! The one thing I'm not sure about is the blocking regions, as that's a pretty large code change and it's easy to miss a spot. I guess nothing really bad happens if you do, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A slight problem here is some of these stats are for the whole system including any iOS daemons that are running and some of these stats are only for processes running inside iSH. This could get a bit confusing in htop if you can see CPU usage for everything but only see some processes in the breakdown. It's probably fine though.
kernel/signal.c
Outdated
@@ -636,8 +636,10 @@ int_t sys_rt_sigsuspend(addr_t mask_addr, uint_t size) { | |||
|
|||
int_t sys_pause() { | |||
lock(¤t->sighand->lock); | |||
while (wait_for(¤t->pause, ¤t->sighand->lock, NULL) != _EINTR) | |||
continue; | |||
TASK_BLOCKING_AREA { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing this, it would make more sense to put the blocking area inside of wait_for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this might bring a deadlock. I just want this blocking defines as simple as possible, so I just put them on the most of blocking syscalls in Linux (list of blocking sys calls). From this list only fcntl and close are not wrapped with TASK_MAY_BLOCK
, since their implementation in our case is not blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list seems outdated? It doesn't include futex or sigsuspend, for example.
18e7f68
to
856e13a
Compare
31c00cd
to
12167ba
Compare
Add apis to collect statisctics on blocked tasks. A scpecial wrapper should be used in areas which may block a task.
@tbodt, hello. I made these changes:
|
Updated /proc/stat to be compatible with Linux's implementation.
Added mainline PR ish-app#1066, procfs enhancements
Incorporated upstream PR ish-app#1066, procps enhancements
Can we get this merged? htop is broken till it is.. |
The reliance on locking/unlocking pids_lock in the TASK_MAY_BLOCK macro is a bit problematic from a performance/reliability perspective as so many other parts of iSH use it as well. |
What's added:
Closes #273