From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-203879-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 69BD115817D
	for <garchives@archives.gentoo.org>; Fri, 14 Jun 2024 19:53:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 34316E2AD2;
	Fri, 14 Jun 2024 19:53:07 +0000 (UTC)
Received: from out.packetderm.com (out.packetderm.com [173.166.91.13])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 6F50CE2AC3
	for <gentoo-user@lists.gentoo.org>; Fri, 14 Jun 2024 19:53:06 +0000 (UTC)
Received: from localhost (out.packetderm.com[173.166.91.13])
        by smtp (5.7.4/5.7.4) with ESMTPSA id 45EJr25K038239
        (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
        for <gentoo-user@lists.gentoo.org>; Fri, 14 Jun 2024 15:53:04 -0400 (EDT)
        (envelope-from waltdnes@waltdnes.org)
Date: Fri, 14 Jun 2024 15:53:04 -0400
From: Walter Dnes <waltdnes@waltdnes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] CPU frequency governors and temperatures
Message-ID: <MTAwMDA0NC53ZG5lc2RheQ.1718394784@quikprotect>
References: <MTAwMDAzMC53ZG5lc2RheQ.1718333560@quikprotect>
 <10483462.nUPlyArG6x@rogueboard>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <10483462.nUPlyArG6x@rogueboard>
X-Archives-Salt: 6fd19d43-307d-46ce-ba94-2edc9fbb4289
X-Archives-Hash: 63994cd2fb30de11581928c18c520b68

On Fri, Jun 14, 2024 at 11:54:52AM +0100, Michael wrote

> I would think 46-48°C is refreshingly cool, but it very much depends
> on the CPU chip, the MoBo and its BIOS/microcode settings.

  I looked up my CPU (see my reply to Dale).  The max temp allowed is
71.3 C.  A short kernel compile is one thing.  I tried schedutil during
an emerge world update, and the temp was hitting 70 C.  Ouch!  schedutil
has to go.

> I recall an early i7 CPU laptop would not go above 2,400MHz when
> 4core/8threads were running, but on single core processes I would
> see it on i7z jumping up to 4,200MHz.

  Speaking of cores+threads... I had always thought my cpu had 12
cores.  i.e. /proc/cpuinfo showed 12 "cpus" as did directory
/sys/devices/system/cpu/  But I was wrong.  The specs show 6 real cores,
plus hyperthreading.  See Greg Kroah-Hartman's presentation about the
security issue called "hyperthreading"...
https://events19.linuxfoundation.org/wp-content/uploads/2018/07/gregkh_mds.pdf
Read it and weep.  Page 6 summarizes it succinctly...

==================================================
  OpenBSD was right
* Guessed more problems would be in this area
* Disabled SMT for Intel chips in June 2018
* Repeated the plea to disable this in August 2018
* Prevented almost all MDS issues automatically
* Security over performance
* Huge respect!
==================================================

  I immediately went into the BIOS and disabled hyperthreading... and
adjusted makeopts in make.conf <G>

> What do you get when you run make with '-j jobs', where jobs=max
> threads of your CPU?

  I hadn't realized that this applied to kernel compiling as well as
portage "emerge".  Since my system now shows 6 (real) cores, I set 5
jobs.  My /usr/src/makeover script is now...

===========================================================
#!/bin/bash
make -j 5 && \
make modules_install && \
cp  arch/x86_64/boot/bzImage /boot/vmlinuz-experimental && \
cp System.map /boot/System.map-experimental && \
cp .config /boot/config-experimental
===========================================================

  Since I wanted to exorcise schedutil from my system, I had an excuse
to run another compile.  From /usr/src/linux I executed...

cp .config ..
make mrproper
cp ../.config .
time ../makeover

  I had manually selected "userspace" and 2900000 khz.  The result was
so farcical, I repeated it a second time to confirm it was for real.

real    4m43.120s
user    20m11.003s
sys     1m25.728s.

  Under 5 minutes.  Like wow!  The CPU stayed pegged at around 2.900 Ghz
and the temperature never got over 47 C.  Thank you very much for that
info about jobs for make.

-- 
Roses are red
Roses are blue
Depending on their velocity
Relative to you