From owner-freebsd-bugs@freebsd.org Wed Jun 3 00:27:43 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 26A1A2FF39F for ; Wed, 3 Jun 2020 00:27:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49c8rH0JKgz4CPH for ; Wed, 3 Jun 2020 00:27:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 0A4032FF4B4; Wed, 3 Jun 2020 00:27:43 +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 0A0772FF43C for ; Wed, 3 Jun 2020 00:27:43 +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 49c8rG6XyTz4CBC for ; Wed, 3 Jun 2020 00:27:42 +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 DC370254D4 for ; Wed, 3 Jun 2020 00:27:42 +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 0530RgPZ011863 for ; Wed, 3 Jun 2020 00:27:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0530RgcW011860 for bugs@FreeBSD.org; Wed, 3 Jun 2020 00:27:42 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: Wed, 03 Jun 2020 00:27:39 +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: cem@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Wed, 03 Jun 2020 00:27:43 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246940 --- Comment #6 from Conrad Meyer --- (In reply to t.eichstaedt from comment #4) > Then what's the idle _user_class_ for? Scheduler prioritization. > IMHO one would expect that idle user tasks are implicitely also (at least= ) nice, same argument: because their scheduling priority is lower than all = nice tasks. This is a misunderstanding. Nice and priority are orthogonal. (In reply to t.eichstaedt from comment #5) > the charge classes supplied by cp_times (roughly) reflect the cpu schedul= ing classes This is also a misunderstanding; it isn't the categorization used by cp_tim= es.=20 Nice is user threads with nice > 0; user is all other user threads. Intr is kernel threads running ithreads. Idle is kernel threads running idle. Sys= is all other kernel threads. That's it. I think it would be reasonable to collect and expose the data you want, and have a power manager (useless as they may be)=E2=80=A0 consume that data in= stead of cp_times. But I don't like changing the historical behavior of cp_times to charge user CPU as kernel CPU, nor do I like adding yet another sysctl knob= for this behavior. (Approximately zero users are going to find and enable this knob. If we want to provide a better laptop experience, it needs to work o= ut of the box.) (=E2=80=A0): User-driven frequency scaling is kind of a losing game at this= point, especially with powerd. Idle C-states consume almost nothing regardless of frequency. Powerd doesn't know how to manage frequency on multiple indepen= dent CPUs. Intel is moving away from OS-driven p-states entirely; future CPUs w= ill simply not support it. (Instead, cores can be set to an energy efficiency profile on some 0-100 percentage scale.) --=20 You are receiving this mail because: You are the assignee for the bug.=