From owner-freebsd-bugs@freebsd.org Fri Jun 5 03:44:08 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3131833DCFB for ; Fri, 5 Jun 2020 03:44:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49dT600bGsz3c7n for ; Fri, 5 Jun 2020 03:44:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 1283D33DDA2; Fri, 5 Jun 2020 03:44:08 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 124CB33DEA8 for ; Fri, 5 Jun 2020 03:44:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49dT5z6mp9z3c45 for ; Fri, 5 Jun 2020 03:44:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3F21A87D for ; Fri, 5 Jun 2020 03:44:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0553i771098395 for ; Fri, 5 Jun 2020 03:44:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0553i7Fo098394 for bugs@FreeBSD.org; Fri, 5 Jun 2020 03:44:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 246940] [wishlist/enhancement, patch incl.]: idle user tasks should be charged as "nice" or "idle" CPU time Date: Fri, 05 Jun 2020 03:44:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: t.eichstaedt@gmx.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2020 03:44:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246940 t.eichstaedt@gmx.net changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #215172|0 |1 is obsolete| | Attachment #215173|0 |1 is obsolete| | --- Comment #8 from t.eichstaedt@gmx.net --- Created attachment 215241 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D215241&action= =3Dedit 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 t= hat. 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]" analo= gue to "pc_cp_time[CPUSTATES]", and I'm not comfortable with that. It will bre= ak 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 stumb= le 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 setti= ng on independant cpu. It also seems fairly simple, though. thx again for your time. --=20 You are receiving this mail because: You are the assignee for the bug.=