From nobody Sun Aug 25 08:38:14 2024 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ws6dk059Yz5VbVH for ; Sun, 25 Aug 2024 08:38:18 +0000 (UTC) (envelope-from SRS0=cvou=PY=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Ws6dh6dRYz441F for ; Sun, 25 Aug 2024 08:38:16 +0000 (UTC) (envelope-from SRS0=cvou=PY=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Sun, 25 Aug 2024 10:38:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1724575095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ISC95xqvQAdvaoYbgC2TCUqim1cYX+TBKMuwYawbaPA=; b=IBUrhzg7qi/sowJw0iaDC8NnIsS7jPtOh1xS/E0peh05Cm0VhfH74GhWltSrO5frSGJLCe CPz0gk/hYxUuDw2fLeJ5m0EAszUo3rlf1s8J2n58GPK+mjnSiclD+JSkc1ZM/R2LfsIkpP G/iWTmimfYrjNrKuHcZlh0lKrkz0gwpuAIWcg41BEWxjTZUVNczYhvtmNef1WrrsY5pF48 jt41/u0/9Iis9sW2ISL8QDIQWIaOaxQDL8xZQQDXCAS2Mc2E21jt+L1T5v4wY9bL6zHYpB 2rMZ3bUN6taIU7xxcTAxrDdRT+y3ZreA4DCmtF+O8VSUQMc785FEvIKjIIDQGg== From: Ronald Klop To: Poul-Henning Kamp Cc: Bob Bishop , "current@freebsd.org" Message-ID: <1273956903.13647.1724575094919@localhost> In-Reply-To: <202408250829.47P8TawP031885@critter.freebsd.dk> References: <202408241706.47OH6LfG023651@critter.freebsd.dk> <202408250513.47P5DDZF029200@critter.freebsd.dk> <1264471055.10452.1724573369940@localhost> <202408250829.47P8TawP031885@critter.freebsd.dk> Subject: Re: powerd forgets top CPU frequency ? List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13646_67042762.1724575094907" X-Mailer: Realworks (717.35) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] X-Rspamd-Queue-Id: 4Ws6dh6dRYz441F ------=_Part_13646_67042762.1724575094907 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Van: Poul-Henning Kamp Datum: zondag, 25 augustus 2024 10:29 Aan: Ronald Klop CC: Bob Bishop , "current@freebsd.org" Onderwerp: Re: powerd forgets top CPU frequency ? > > -------- > Ronald Klop writes: > > > A bit weird to try to give suggestions knowing how experienced you are in FreeBSD. But here we go, > > I'm not very experienced with how modern CPU's are modulated :-) > > > 1. What does the sysctl about cpu frequencies say. Does that value decrease too? > > On my machine it is this: > > # sysctl dev.cpu | grep freq > > dev.cpu.0.freq_levels: 1500/-1 600/-1 > > dev.cpu.0.freq: 1500 > > Right now: > dev.cpu.7.freq_levels: 2803/-1 > dev.cpu.7.freq: 3103 > dev.cpu.5.freq_levels: 2803/-1 > dev.cpu.5.freq: 3103 > dev.cpu.3.freq_levels: 2803/-1 > dev.cpu.3.freq: 3103 > dev.cpu.1.freq_levels: 2803/-1 > dev.cpu.1.freq: 3103 > dev.cpu.6.freq_levels: 2803/-1 > dev.cpu.6.freq: 3103 > dev.cpu.4.freq_levels: 2803/-1 > dev.cpu.4.freq: 3103 > dev.cpu.2.freq_levels: 2803/-1 > dev.cpu.2.freq: 3103 > dev.cpu.0.freq_levels: 2803/-1 > dev.cpu.0.freq: 3103 > > > 2. Does https://www.freshports.org/sysutils/powerdxx/ exhibit the same issue? To rule out if it is in the binary or in the kernel. > > Will try. > > > 3. out-of-the-box: are your CPUs similar? So, do both have the same top frequency? > > Yes, it's a: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz > > > 4. And powerd(8) mentions a -v option: "Verbose mode. Messages about power changes will be printed to stdout and powerd will operate in the foreground." > > Does that print anything useful? > > Yes, that's where I noticed the "gradually run slower and slower"... > > Initially I thought it was some kind of thermal throttling, but leaving the computer > idle overnight did not lead to automatic recovery, whereas reboots and as far as I > can tell, restarting powerd does. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > > > dev.cpu.7.freq_levels: 2803/-1 dev.cpu.7.freq: 3103 This is interesting by itself. According to the sysctl the CPU only has 1 frequency to select, which is 2803, but it is running on 3103. Maybe there is some other mechanism which influences the CPU freq on your machine. I hope somebody else can shine some light on this. Doesn't the output (or source) of powerd give some insight on why it makes the decisions it makes? Regards, Ronald. ------=_Part_13646_67042762.1724575094907 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

Van: Poul-Henning Kamp <phk@phk.freebsd.dk>
Datum: zondag, 25 augustus 2024 10:29
Aan: Ronald Klop <ronald-lists@klop.ws>
CC: Bob Bishop <rb@gid.co.uk>, "current@freebsd.org" <current@FreeBSD.org>
Onderwerp: Re: powerd forgets top CPU frequency ?

--------
Ronald Klop writes:

> A bit weird to try to give suggestions knowing how experienced you are in FreeBSD. But here we go,

I'm not very experienced with how modern CPU's are modulated :-)

> 1. What does the sysctl about cpu frequencies say. Does that value decrease too?
> On my machine it is this:
> # sysctl dev.cpu  | grep freq
> dev.cpu.0.freq_levels: 1500/-1 600/-1
> dev.cpu.0.freq: 1500

Right now:
    dev.cpu.7.freq_levels: 2803/-1
    dev.cpu.7.freq: 3103
    dev.cpu.5.freq_levels: 2803/-1
    dev.cpu.5.freq: 3103
    dev.cpu.3.freq_levels: 2803/-1
    dev.cpu.3.freq: 3103
    dev.cpu.1.freq_levels: 2803/-1
    dev.cpu.1.freq: 3103
    dev.cpu.6.freq_levels: 2803/-1
    dev.cpu.6.freq: 3103
    dev.cpu.4.freq_levels: 2803/-1
    dev.cpu.4.freq: 3103
    dev.cpu.2.freq_levels: 2803/-1
    dev.cpu.2.freq: 3103
    dev.cpu.0.freq_levels: 2803/-1
    dev.cpu.0.freq: 3103

> 2. Does https://www.freshports.org/sysutils/powerdxx/ exhibit the same issue? To rule out if it is in the binary or in the kernel.

Will try.

> 3. out-of-the-box: are your CPUs similar? So, do both have the same top frequency?

Yes, it's a: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

> 4. And powerd(8) mentions a -v option: "Verbose mode.  Messages about power changes will be printed to stdout and powerd will operate in the foreground."
> Does that print anything useful?

Yes, that's where I noticed the "gradually run slower and slower"...

Initially I thought it was some kind of thermal throttling, but leaving the computer
idle overnight did not lead to automatic recovery, whereas reboots and as far as I
can tell, restarting powerd does.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



    dev.cpu.7.freq_levels: 2803/-1
    dev.cpu.7.freq: 3103


This is interesting by itself. According to the sysctl the CPU only has 1 frequency to select, which is 2803, but it is running on 3103. Maybe there is some other mechanism which influences the CPU freq on your machine. I hope somebody else can shine some light on this.
Doesn't the output (or source) of powerd give some insight on why it makes the decisions it makes?

Regards,
Ronald.
  ------=_Part_13646_67042762.1724575094907--