[Bug 246940] [wishlist/enhancement, patch incl.]: idle user tasks should be charged as "nice" or "idle" CPU time
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Jun 5 03:44:08 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246940
t.eichstaedt at gmx.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #215172|0 |1
is obsolete| |
Attachment #215173|0 |1
is obsolete| |
--- Comment #8 from t.eichstaedt at gmx.net ---
Created attachment 215241
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=215241&action=edit
expose add. cp_time(s) (realtime/idle) via sysctl cp_time(s)_ext
Now guess what, that was so simple that it succeeded to compile on the 3rd try
(only typos), and it runs on bare metal on the 1st -- I'm writing this with the
patch applied. I was too lazy to beadm or set up a VM to test.
If I violated any written or unspoken guidelines/rules, please let me know
(PLMK).
The Dev Handbook is on top of my list to read, but for now I just followed what
I saw in the src code.
I took the freedom to add some comments and documentation which might write out
what is already clear to the avg audience. If so, PLMK, and I'll fix all that.
I want to do it the BSD way, and no quick hack.
In pcpu.h:struct pcpu{}, I added "long pc_cp_time_ext[CPUSTATES_EXT]" analogue
to "pc_cp_time[CPUSTATES]", and I'm not comfortable with that. It will break
some base and port apps, right? top(1) runs... but others?
Strictly speaking, a new sysctl is not neccessary, as I also added
resource.h:read_cpu_time_ext() analogue to read_cpu_time(). IMHO it's kind to
have a sysctl, because curious folk who will make use out of it, will stumble
over this more likely than if it's hidden in a header file.
Now if you approve this patch, I can start patching powerd(8) to make use of
it, but I fear to start an avalanche, esp. concerning supporting freq setting
on independant cpu. It also seems fairly simple, though.
thx again for your time.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list